Home liberachat/#haskell: Logs Calendar

Logs on 2021-12-23 (liberachat/#haskell)

00:02:57 × falafel quits (~falafel@2603-8000-d800-688c-6093-c6e0-4810-959c.res6.spectrum.com) (Ping timeout: 240 seconds)
00:09:22 kayvank joins (~user@52-119-115-185.PUBLIC.monkeybrains.net)
00:10:07 sprout joins (~quassel@2a02:a467:ccd6:1:21ba:a382:6b6:54c4)
00:11:39 qrpnxz parts (abc4f95c31@user/qrpnxz) (Disconnected: closed)
00:11:45 qrpnxz joins (abc4f95c31@user/qrpnxz)
00:14:53 × sprout quits (~quassel@2a02:a467:ccd6:1:21ba:a382:6b6:54c4) (Ping timeout: 268 seconds)
00:15:02 bu5hyt0p_ joins (~rmsare@2601:281:c780:a510:6d40:63c6:3a27:e5b8)
00:15:09 × zer0bitz quits (~zer0bitz@2001:2003:f444:a000:e954:6a22:3202:5b23) (Ping timeout: 250 seconds)
00:15:14 qrpnxz parts (abc4f95c31@user/qrpnxz) (Disconnected: Replaced by new connection)
00:15:15 qrpnxz joins (abc4f95c31@user/qrpnxz)
00:15:47 qrpnxz parts (abc4f95c31@user/qrpnxz) (Disconnected: closed)
00:15:57 qrpnxz joins (abc4f95c31@user/qrpnxz)
00:17:39 fizbin joins (~fizbin@c-73-33-197-160.hsd1.nj.comcast.net)
00:18:45 merijn joins (~merijn@83-160-49-249.ip.xs4all.nl)
00:19:32 <jackdk> I think you're meant to have a comma in between
00:20:24 <space_llama> you mean just before gloss?
00:21:57 × fizbin quits (~fizbin@c-73-33-197-160.hsd1.nj.comcast.net) (Ping timeout: 256 seconds)
00:22:21 <sm> space_llama: there's a problem with your gloss line. the number on left should be the lowest allowed version, number on right is the highest
00:22:21 <g> ^>= x.y.z.u == >= x.y.z.u && < x.(y+1)
00:22:47 <g> https://cabal.readthedocs.io/en/3.6/cabal-package.html#pkg-field-build-depends
00:25:02 × vicfred quits (~vicfred@user/vicfred) (Quit: Leaving)
00:27:21 eggplantade joins (~Eggplanta@2600:1700:bef1:5e10:319d:53ed:6690:e5b4)
00:29:07 × doyougnu quits (~doyougnu@c-73-25-202-122.hsd1.or.comcast.net) (Remote host closed the connection)
00:31:37 × eggplantade quits (~Eggplanta@2600:1700:bef1:5e10:319d:53ed:6690:e5b4) (Ping timeout: 240 seconds)
00:34:05 qrpnxz parts (abc4f95c31@user/qrpnxz) (Disconnected: Replaced by new connection)
00:34:06 qrpnxz joins (abc4f95c31@user/qrpnxz)
00:34:35 × jgeerds quits (~jgeerds@55d4ac73.access.ecotel.net) (Ping timeout: 252 seconds)
00:34:35 qrpnxz parts (abc4f95c31@user/qrpnxz) (Disconnected: closed)
00:34:41 qrpnxz joins (abc4f95c31@user/qrpnxz)
00:43:09 × pretty_dumm_guy quits (trottel@gateway/vpn/protonvpn/prettydummguy/x-88029655) (Quit: WeeChat 3.4)
00:43:26 sprout joins (~quassel@2a02:a467:ccd6:1:bc5b:dbe0:79e5:a909)
00:46:39 × Midjak quits (~Midjak@may53-1-78-226-116-92.fbx.proxad.net) (Quit: Leaving)
00:48:06 lavaman joins (~lavaman@98.38.249.169)
00:48:13 × sprout quits (~quassel@2a02:a467:ccd6:1:bc5b:dbe0:79e5:a909) (Ping timeout: 240 seconds)
00:48:15 yin joins (~yin@user/zero)
00:48:51 wroathe joins (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net)
00:48:51 × wroathe quits (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Changing host)
00:48:51 wroathe joins (~wroathe@user/wroathe)
00:49:05 <jackdk> space_llama: yes
00:51:46 yauhsien joins (~yauhsien@118-167-43-174.dynamic-ip.hinet.net)
00:52:37 × merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 240 seconds)
00:52:38 × lavaman quits (~lavaman@98.38.249.169) (Ping timeout: 260 seconds)
00:56:12 <yin> i don't understand why my solution hangs for aoc 15.2
00:57:12 <yin> can anyone help me? this should be straightforward
00:57:15 <yin> https://paste.jrvieira.com/1640221005314
00:58:02 × acidjnk quits (~acidjnk@p200300d0c7271e77d154eb1f1200bcdb.dip0.t-ipconnect.de) (Ping timeout: 268 seconds)
00:58:47 <yin> runs fine for part1 and all tests, including part2 test
01:01:43 sprout joins (~quassel@2a02:a467:ccd6:1:bc5b:dbe0:79e5:a909)
01:02:26 × timCF quits (~timCF@m91-129-100-224.cust.tele2.ee) (Quit: leaving)
01:03:00 × xkuru quits (~xkuru@user/xkuru) (Read error: Connection reset by peer)
01:06:29 × space_llama quits (~Guest|47@c-73-221-44-172.hsd1.wa.comcast.net) (Quit: Connection closed)
01:06:41 × sprout quits (~quassel@2a02:a467:ccd6:1:bc5b:dbe0:79e5:a909) (Ping timeout: 268 seconds)
01:06:48 eggplantade joins (~Eggplanta@2600:1700:bef1:5e10:319d:53ed:6690:e5b4)
01:10:59 [itchyjunk] joins (~itchyjunk@user/itchyjunk/x-7353470)
01:13:05 machinedgod joins (~machinedg@24.105.81.50)
01:13:31 × wroathe quits (~wroathe@user/wroathe) (Ping timeout: 256 seconds)
01:18:05 qrpnxz parts (abc4f95c31@user/qrpnxz) (Disconnected: Replaced by new connection)
01:18:06 qrpnxz joins (abc4f95c31@user/qrpnxz)
01:18:16 sprout joins (~quassel@2a02:a467:ccd6:1:bc5b:dbe0:79e5:a909)
01:18:35 qrpnxz parts (abc4f95c31@user/qrpnxz) (Disconnected: closed)
01:18:43 qrpnxz joins (abc4f95c31@user/qrpnxz)
01:18:59 × Morrow quits (~quassel@bzq-110-168-31-106.red.bezeqint.net) (Remote host closed the connection)
01:22:37 × sprout quits (~quassel@2a02:a467:ccd6:1:bc5b:dbe0:79e5:a909) (Ping timeout: 240 seconds)
01:23:14 wroathe joins (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net)
01:23:14 × wroathe quits (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Changing host)
01:23:14 wroathe joins (~wroathe@user/wroathe)
01:28:16 wroathe_ joins (~wroathe@206-55-188-8.fttp.usinternet.com)
01:28:49 × wroathe quits (~wroathe@user/wroathe) (Ping timeout: 256 seconds)
01:29:29 × CiaoSen quits (~Jura@p200300c957347b002a3a4dfffe84dbd5.dip0.t-ipconnect.de) (Ping timeout: 268 seconds)
01:29:58 × wroathe_ quits (~wroathe@206-55-188-8.fttp.usinternet.com) (Read error: Connection reset by peer)
01:33:16 wroathe joins (~wroathe@206-55-188-8.fttp.usinternet.com)
01:33:16 × wroathe quits (~wroathe@206-55-188-8.fttp.usinternet.com) (Changing host)
01:33:16 wroathe joins (~wroathe@user/wroathe)
01:34:38 × FinnElija quits (~finn_elij@user/finn-elija/x-0085643) (Remote host closed the connection)
01:35:04 FinnElija joins (~finn_elij@user/finn-elija/x-0085643)
01:36:46 johnw joins (~johnw@2607:f6f0:3004:1:c8b4:50ff:fef8:6bf0)
01:39:24 × Tuplanolla quits (~Tuplanoll@91-159-69-214.elisa-laajakaista.fi) (Quit: Leaving.)
01:41:57 rekahsoft joins (~rekahsoft@cpe0008a20f982f-cm64777d666260.cpe.net.cable.rogers.com)
01:43:12 nikkc joins (~nikkc@2603-7080-0103-7aa9-35ff-3499-0703-1f10.res6.spectrum.com)
01:45:04 wroathe_ joins (~wroathe@206-55-188-8.fttp.usinternet.com)
01:45:23 <EvanR> yin, are you building a Data.Map from an infinite list of pairs
01:45:24 jay-invariant joins (~jay@c-24-4-6-169.hsd1.ca.comcast.net)
01:45:31 × jay-invariant quits (~jay@c-24-4-6-169.hsd1.ca.comcast.net) (Client Quit)
01:45:50 × kaph quits (~kaph@net-2-47-236-216.cust.vodafonedsl.it) (Ping timeout: 260 seconds)
01:46:39 × wroathe_ quits (~wroathe@206-55-188-8.fttp.usinternet.com) (Client Quit)
01:46:56 wroathe_ joins (~wroathe@206-55-188-8.fttp.usinternet.com)
01:48:05 × wroathe quits (~wroathe@user/wroathe) (Ping timeout: 256 seconds)
01:49:26 nuh^ joins (~nuh@64.253.22.77)
01:51:26 × chomwitt quits (~chomwitt@2a02:587:dc1c:a00:12c3:7bff:fe6d:d374) (Ping timeout: 260 seconds)
01:54:09 × burnsidesLlama quits (~burnsides@dhcp168-011.wadham.ox.ac.uk) (Remote host closed the connection)
01:54:47 falafel joins (~falafel@2603-8000-d800-688c-eced-9d48-e094-4d30.res6.spectrum.com)
01:58:03 justsomeguy joins (~justsomeg@user/justsomeguy)
01:58:07 × wroathe_ quits (~wroathe@206-55-188-8.fttp.usinternet.com) (Quit: leaving)
01:58:20 wroathe joins (~wroathe@206-55-188-8.fttp.usinternet.com)
01:58:20 × wroathe quits (~wroathe@206-55-188-8.fttp.usinternet.com) (Changing host)
01:58:20 wroathe joins (~wroathe@user/wroathe)
01:58:31 falafel_ joins (~falafel@2603-8000-d800-688c-502d-7280-71cc-20e7.res6.spectrum.com)
01:58:36 Inst joins (~delicacie@2601:6c4:4080:3f80:e482:21a8:3024:fee0)
02:00:57 × falafel quits (~falafel@2603-8000-d800-688c-eced-9d48-e094-4d30.res6.spectrum.com) (Ping timeout: 240 seconds)
02:07:39 × machinedgod quits (~machinedg@24.105.81.50) (Read error: Connection reset by peer)
02:08:01 machinedgod joins (~machinedg@24.105.81.50)
02:09:34 jz99 joins (~jz99@150.203.2.50)
02:18:36 <iphy> https://github.com/TokTok/hs-cimple/blob/master/src/Language/Cimple/TraverseAst.hs#L53 is there any way to generalise this to arbitrary types for "text", not just Text?
02:19:49 × nuh^ quits (~nuh@64.253.22.77) (Ping timeout: 256 seconds)
02:20:10 nuh^ joins (~nuh@64.253.22.77)
02:21:14 <iphy> this one: https://github.com/TokTok/hs-cimple/blob/master/src/Language/Cimple/TraverseAst.hs#L19
02:21:41 <iphy> I want to make that "Text" a type parameter
02:25:16 <iphy> MultiParamTypeClasses works, cool
02:25:29 × wroathe quits (~wroathe@user/wroathe) (Ping timeout: 256 seconds)
02:26:12 × shapr quits (~user@pool-100-36-247-68.washdc.fios.verizon.net) (Remote host closed the connection)
02:26:18 phma_ is now known as phma
02:26:29 shapr joins (~user@pool-100-36-247-68.washdc.fios.verizon.net)
02:27:32 burnsidesLlama joins (~burnsides@dhcp168-011.wadham.ox.ac.uk)
02:31:23 zmt01 joins (~zmt00@user/zmt00)
02:31:49 × burnsidesLlama quits (~burnsides@dhcp168-011.wadham.ox.ac.uk) (Ping timeout: 240 seconds)
02:32:16 wroathe joins (~wroathe@206-55-188-8.fttp.usinternet.com)
02:32:16 × wroathe quits (~wroathe@206-55-188-8.fttp.usinternet.com) (Changing host)
02:32:16 wroathe joins (~wroathe@user/wroathe)
02:35:17 × zmt00 quits (~zmt00@user/zmt00) (Ping timeout: 240 seconds)
02:36:57 × neurocyte0132889 quits (~neurocyte@user/neurocyte) (Ping timeout: 240 seconds)
02:37:37 × whatsupdoc quits (uid509081@id-509081.hampstead.irccloud.com) (Quit: Connection closed for inactivity)
02:38:08 × nikkc quits (~nikkc@2603-7080-0103-7aa9-35ff-3499-0703-1f10.res6.spectrum.com) (Quit: Client closed)
02:39:50 × justsomeguy quits (~justsomeg@user/justsomeguy) (Quit: WeeChat 3.3)
02:43:17 × raehik quits (~raehik@cpc95906-rdng25-2-0-cust156.15-3.cable.virginm.net) (Ping timeout: 240 seconds)
02:43:33 isovector1 joins (~isovector@172.103.216.166)
02:49:28 merijn joins (~merijn@83-160-49-249.ip.xs4all.nl)
02:53:20 × thaumavorio quits (~thaumavor@thaumavor.io) (Quit: ZNC 1.8.2 - https://znc.in)
02:53:24 Guest|47 joins (~Guest|47@c-73-221-44-172.hsd1.wa.comcast.net)
02:54:06 × xff0x quits (~xff0x@2001:1a81:5290:1c00:84df:602d:a0a9:8535) (Ping timeout: 245 seconds)
02:55:17 Guest|47 is now known as frumple_Doop
02:56:10 xff0x joins (~xff0x@2001:1a81:52d0:e400:204:565d:57ea:f23d)
03:00:42 burnsidesLlama joins (~burnsides@dhcp168-011.wadham.ox.ac.uk)
03:03:43 × jackson99 quits (~bc8147f2@83.167.180.121) (Quit: CGI:IRC (Session timeout))
03:05:41 × burnsidesLlama quits (~burnsides@dhcp168-011.wadham.ox.ac.uk) (Ping timeout: 268 seconds)
03:05:52 dustee joins (~dustee@2601:244:4400:eb2:41c1:aef3:8d9c:ccf0)
03:10:32 × xff0x quits (~xff0x@2001:1a81:52d0:e400:204:565d:57ea:f23d) (Ping timeout: 240 seconds)
03:11:23 xff0x joins (~xff0x@2001:1a81:52d0:e400:5fba:65e0:daae:59c3)
03:12:09 qrpnxz parts (abc4f95c31@user/qrpnxz) (Disconnected: Replaced by new connection)
03:12:10 qrpnxz joins (abc4f95c31@user/qrpnxz)
03:12:39 qrpnxz parts (abc4f95c31@user/qrpnxz) (Disconnected: closed)
03:12:45 qrpnxz joins (abc4f95c31@user/qrpnxz)
03:13:57 sim590 joins (~simon@modemcable090.207-203-24.mc.videotron.ca)
03:16:23 deadmarshal joins (~deadmarsh@95.38.231.102)
03:17:46 × td_ quits (~td@94.134.91.68) (Ping timeout: 260 seconds)
03:19:30 × dustee quits (~dustee@2601:244:4400:eb2:41c1:aef3:8d9c:ccf0) (Quit: Client closed)
03:19:39 td_ joins (~td@94.134.91.61)
03:20:32 × deadmarshal quits (~deadmarsh@95.38.231.102) (Ping timeout: 240 seconds)
03:22:27 <sim590> I'm trying to find out reciprocal cycles in a number's digits. Let's say I have the fraction 1/7 which gives 0.1428571..., then I find the digits [1,4,2,8,5,7,1,4,2,8,5,7,...]. I want to detect the repeating cycle in the digits which should be [1,4,2,8,5,7]. This cycle should be detected as starting at some point in the digits list and never ending at infinity. My approach is to reverse the list
03:22:29 <sim590> of digits and call the following function on it ( head . head . dropWhile ((==1) . length) . group . groupBy (/=)) in order to find the cycle. Does that approach make sense to you ?
03:23:17 × Erutuon quits (~Erutuon@user/erutuon) (Ping timeout: 240 seconds)
03:23:34 × machinedgod quits (~machinedg@24.105.81.50) (Ping timeout: 268 seconds)
03:23:51 × merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 256 seconds)
03:25:55 Erutuon joins (~Erutuon@user/erutuon)
03:27:18 <sim590> I'm asking because this is part of a problem on projecteuler and when I call my code to look for the longest cycle in the 1000 first numbers in the sequence 1/1, 1/2, ... 1/1000, then I don't get the right answer. I thought my approach should work, but I'm not sure what's missing
03:29:27 <sm> https://www.volunteeramnestyday.net . Thanks joeyh
03:31:53 deadmarshal joins (~deadmarsh@95.38.231.102)
03:33:54 <sim590> Here's the whole code I'm trying to run: http://ix.io/3Jcb
03:35:58 sprout joins (~quassel@2a02:a467:ccd6:1:bc5b:dbe0:79e5:a909)
03:36:53 <juhp> hm, does converting a product type to a record doesn't require a PVP major version bump, right?
03:40:37 × sprout quits (~quassel@2a02:a467:ccd6:1:bc5b:dbe0:79e5:a909) (Ping timeout: 240 seconds)
03:41:17 kaph_ joins (~kaph@net-2-47-236-216.cust.vodafonedsl.it)
03:43:55 × rekahsoft quits (~rekahsoft@cpe0008a20f982f-cm64777d666260.cpe.net.cable.rogers.com) (Ping timeout: 268 seconds)
03:44:03 thaumavorio joins (~thaumavor@thaumavor.io)
03:47:56 × isovector1 quits (~isovector@172.103.216.166) (Quit: Leaving)
03:53:07 × yauhsien quits (~yauhsien@118-167-43-174.dynamic-ip.hinet.net) (Remote host closed the connection)
03:54:51 yauhsien joins (~yauhsien@118-167-43-174.dynamic-ip.hinet.net)
03:59:17 × yauhsien quits (~yauhsien@118-167-43-174.dynamic-ip.hinet.net) (Ping timeout: 240 seconds)
04:03:02 × notzmv quits (~zmv@user/notzmv) (Ping timeout: 240 seconds)
04:07:54 <mniip> sim590, what you should be looking for is when you hit the same remainder in long division
04:08:08 <mniip> you can't tell if it's a cycle or not from just the digits
04:08:39 <sim590> But I thought that using a big enough precision would do, no?
04:08:45 <sim590> I have like 100 digits numbers.
04:08:56 <mniip> what you're doing is finding the first digit that repeats, no?
04:09:09 qrpnxz parts (abc4f95c31@user/qrpnxz) (Disconnected: Replaced by new connection)
04:09:09 <monochrom> Consider 0.1213141512131415...
04:09:10 qrpnxz joins (abc4f95c31@user/qrpnxz)
04:09:18 sprout joins (~quassel@2a02:a467:ccd6:1:bc5b:dbe0:79e5:a909)
04:09:27 <sim590> Yes, in the first groupBy, but the second call of group clears everything about
04:09:32 <sim590> clears everything out*
04:09:40 qrpnxz parts (abc4f95c31@user/qrpnxz) (Disconnected: closed)
04:09:53 qrpnxz joins (abc4f95c31@user/qrpnxz)
04:09:59 <mniip> clears... what out?
04:09:59 <sim590> Because then I can see which lists in the list [[[Integer]]] that is only of length 1.
04:10:13 <sim590> Because it lets me know about the repeating cycles
04:10:32 <sim590> If it's repeating, some list [[Integer]] will have length > 1
04:10:34 <mniip> see monochrom's example
04:11:29 <mniip> (in case you're uncertain, it *is* a rational number)
04:11:31 <mniip> > 1347935/11111111 :: CReal
04:11:33 <lambdabot> 0.1213141512131415121314151213141512131415
04:11:44 <sim590> Yeah. Let me run my code on that.
04:11:54 qrpnxz parts (abc4f95c31@user/qrpnxz) (Disconnected: Replaced by new connection)
04:11:56 qrpnxz joins (abc4f95c31@user/qrpnxz)
04:12:21 <monochrom> To be fair, if it's just 1/n and n<=1000, there may be a nice lower bound on how bad it gets.
04:12:23 <mniip> as I said digits are really not the information you should be looking for
04:12:24 qrpnxz parts (abc4f95c31@user/qrpnxz) (Disconnected: closed)
04:12:34 qrpnxz joins (abc4f95c31@user/qrpnxz)
04:12:50 <mniip> when you do long division, you eventually run out of digits in the dividend. That's where the repeating pattern starts
04:13:12 <monochrom> But by the time you find out that bound by hand, you have already solved the original problem by hand, too.
04:13:13 <mniip> each digit is dictated by the value of the remainder you currently have, so it will loop precisely when the remainder loops
04:13:24 × kayvank quits (~user@52-119-115-185.PUBLIC.monkeybrains.net) (Remote host closed the connection)
04:13:38 <mniip> digits may repeat but remainders will not
04:13:45 <monochrom> The reason why PE is not for exercises in coding up brute-forcing.
04:14:45 × sprout quits (~quassel@2a02:a467:ccd6:1:bc5b:dbe0:79e5:a909) (Ping timeout: 268 seconds)
04:15:05 <sim590> My code will give that: [[[5,1,4,1,3,1,2,1], [5,1,4,1,3,1,2,1], [5,1,4,1,3,1,2,1], [5,1,4,1,3,1,2,1]]] on the input you mentioned.
04:15:29 <mniip> ok now try 1/10th of the number
04:15:38 × Feuermagier quits (~Feuermagi@user/feuermagier) (Ping timeout: 260 seconds)
04:15:52 <monochrom> And the reason why I mock people with "If one day PE poses 'count how many even primes are in the range 1 to 2^(2^n), people will actually code up a loop of 2^(2^n) iterations".
04:16:00 <mniip> your algorithm depends on where you cut the number off
04:16:11 <mniip> oh PE is project euler
04:16:59 <mniip> advent of cope tends to be exercises in brute forcing :(
04:18:10 <int-e> PE tends to require brute force on top of a shortcut
04:18:10 <sim590> My code also removes leading zeroes.
04:18:18 <sim590> mniip: ^
04:18:23 <sim590> So It doesn't change.
04:18:39 <mniip> ok then
04:18:57 <mniip> 5690349/11111111
04:19:54 <sim590> mniip: http://ix.io/3Jco
04:20:07 <mniip> yeah
04:20:20 fizbin joins (~fizbin@c-73-33-197-160.hsd1.nj.comcast.net)
04:20:22 <mniip> so head.head is [1,2]?
04:20:36 <sim590> Yeah....
04:20:40 <sim590> Hmmmmmmmmmmmmmmmm
04:20:44 <int-e> . o O ( Oh no, why are there floating point numbers... )
04:21:39 <monochrom> 1/(the largest prime below 1000) may be the winner.
04:22:27 <sim590> OK, so there's some mathematical insight I don't see right now which needs to be used to resolve this? I can't fix my approach in order to get it?
04:22:37 <sim590> And why does my approach breka.
04:22:39 <sim590> break*
04:22:54 <sim590> Because groupBy (/=) doesn't really do what I want, right?
04:22:55 <mniip> I said from the start, the digits are not a good medium
04:23:08 <mniip> you should not be looking at the digits to tell where they loop
04:23:14 <mniip> you should be looking at what produced the digits
04:23:31 <sim590> So there's a relation between the nature of the number and the looping of its digits?
04:23:31 <mniip> from the digits themselves it would be impossible
04:23:37 <sim590> That's some math theorem I guess.
04:23:50 <mniip> it doesn't really have a name
04:24:03 <EvanR> this talk of repeating digits screams "continued fractions" for some reason
04:24:12 <mniip> but yeah, long division by X is a state machine with X states
04:24:39 <EvanR> i guess in a continued fraction, nothing repeats in any base
04:24:53 <EvanR> for rationals
04:25:04 <mniip> once the dividend digits run out, all the output depends on is the remainder
04:25:14 × fizbin quits (~fizbin@c-73-33-197-160.hsd1.nj.comcast.net) (Ping timeout: 268 seconds)
04:25:34 <mniip> every time you have some remainder R, you compute the next digit with (R * 10 `div` D) and the next remainder with (R * 10 `mod` D)
04:26:01 <mniip> the latter process obviously keeps you between [0..D-1]
04:26:09 <mniip> so eventually you're bound to repeat the R
04:26:26 mbuf joins (~Shakthi@223.178.76.172)
04:26:39 <mniip> after no longer than D iterations (and actually the number of iterations will divide into D)
04:26:51 <int-e> monochrom: Amazingly some of the winners (when varying the upper bound N) are not prime: 289 and 361 (and /maybe/ more, though it's heuristically unlikely.)
04:26:52 <mniip> er
04:26:58 <mniip> D-1 and D-1 respectively
04:27:41 <int-e> > 1/101
04:27:42 <lambdabot> 9.900990099009901e-3
04:27:47 <int-e> and not all primes are good
04:28:08 fizbin joins (~fizbin@c-73-33-197-160.hsd1.nj.comcast.net)
04:30:54 <monochrom> Yeah the true story involves some primitive root, 10, and the denominator.
04:30:57 × Henson quits (~kvirc@107-179-133-201.cpe.teksavvy.com) (Ping timeout: 240 seconds)
04:32:13 <int-e> monochrom: yeah I'm using znorder in pari/gp
04:32:58 <monochrom> pari/gp is the preferred programming language for PE >:)
04:33:05 <sim590> OK, so when you compute the remainder of some 1/d division and try to figure out the digits one by one, you have to count the number of iterations before you get on the same remainder. And then, you know the length of the cyle, right ? mniip
04:33:14 alfonsox joins (~quassel@103.92.42.192)
04:33:17 <mniip> yeah
04:36:16 Feuermagier joins (~Feuermagi@user/feuermagier)
04:38:37 × deadmarshal quits (~deadmarsh@95.38.231.102) (Ping timeout: 240 seconds)
04:38:57 deadmarshal joins (~deadmarsh@95.38.231.102)
04:41:37 sprout joins (~quassel@2a02:a467:ccd6:1:bc5b:dbe0:79e5:a909)
04:42:38 × Feuermagier quits (~Feuermagi@user/feuermagier) (Ping timeout: 252 seconds)
04:43:28 <sim590> hmmmmmmmmmmm OK. Figuring out the digits with (r*10 `div` d) and (r*10 `mod` d) is something I didn't know. So if I understand correctly, at first you do (1*10 `div` d) to get the first digit. Then you can find the remainder r0 = (r0*10 `mod` d). This gives the second digit: r0*10 `div` d.
04:43:38 × deadmarshal quits (~deadmarsh@95.38.231.102) (Ping timeout: 260 seconds)
04:44:04 <sim590> And so on...
04:44:34 <sim590> But is it equivalent to look for a cycle in the digit or am I obligated to look at the remainder?
04:45:33 <EvanR> also divMod to do it in one step
04:45:43 <sim590> Because I could have the same digit but not have a cycle. Why does the remainder looping gives us a true cycle for sure?
04:45:44 Feuermagier joins (~Feuermagi@user/feuermagier)
04:45:51 <EvanR> you can't just look at digits, I think people explained why
04:45:58 <sim590> EvanR: oh nice!
04:46:13 × wroathe quits (~wroathe@user/wroathe) (Ping timeout: 240 seconds)
04:46:17 × sprout quits (~quassel@2a02:a467:ccd6:1:bc5b:dbe0:79e5:a909) (Ping timeout: 240 seconds)
04:46:20 <EvanR> also they explained why the remainder being bounded results in a loop
04:46:33 <EvanR> which explains why doing a "long square root" of 2 does not loop
04:46:36 <sim590> OK, I'll read again
04:46:52 <EvanR> or doesn't necessarily loop, anyway
04:48:25 justsomeguy joins (~justsomeg@user/justsomeguy)
04:49:25 <monochrom> The suffix of the digit sequence is controlled by the remainder only. Seeing the same remainder for the second time means seeing the same suffix again.
04:49:52 lavaman joins (~lavaman@98.38.249.169)
04:50:01 <monochrom> A finite-state Moore or Mealey machine that doesn't need input. I forgot which.
04:50:32 <monochrom> An unfoldr of a state-transition function of finitely many states.
04:52:47 <EvanR> a moore machine's next state only depends on the current state (no input)
04:53:17 <EvanR> finite numbers of states = necessarily loops (proof left as exercise!)
04:54:50 <int-e> EvanR: Uh, you're wrong.
04:54:50 × lavaman quits (~lavaman@98.38.249.169) (Ping timeout: 268 seconds)
04:55:27 <int-e> The state transition function is the same in both models, it's just about the output. And no, I can't remember which is which :P
04:55:38 <int-e> It hardly ever comes up.
04:55:50 deadmarshal joins (~deadmarsh@95.38.231.102)
04:56:06 <EvanR> damn
04:57:12 <int-e> (and when there's no input, the difference disappears. maybe monochrom was joking about not remembering)
04:58:08 <monochrom> Oh haha accidental pun.
04:58:20 <monochrom> But I really don't remember and too lazy to find out.
04:58:32 <EvanR> now it feels like we're arguing over if bamboo "really is" "a grass" xD. But yeah if I remember a second time, mealy machine also includes an output that depends on state and input
04:58:42 sprout joins (~quassel@2a02:a467:ccd6:1:bc5b:dbe0:79e5:a909)
04:59:20 <EvanR> the finite states resulting in a loop doesn't depend on science culture jargon though
04:59:20 × jz99 quits (~jz99@150.203.2.50) (Quit: Client closed)
05:00:48 <EvanR> mealy machine's output is relevant in the package `machines'
05:10:37 × falafel_ quits (~falafel@2603-8000-d800-688c-502d-7280-71cc-20e7.res6.spectrum.com) (Ping timeout: 240 seconds)
05:15:06 yauhsien joins (~yauhsien@118-167-43-174.dynamic-ip.hinet.net)
05:17:40 hololeap joins (~hololeap@user/hololeap)
05:19:59 merijn joins (~merijn@83-160-49-249.ip.xs4all.nl)
05:26:29 × Feuermagier quits (~Feuermagi@user/feuermagier) (Remote host closed the connection)
05:26:47 Feuermagier joins (~Feuermagi@user/feuermagier)
05:28:32 bitmapper joins (uid464869@id-464869.lymington.irccloud.com)
05:29:57 × rembo10 quits (~rembo10@remulis.com) (Ping timeout: 250 seconds)
05:30:57 × Feuermagier quits (~Feuermagi@user/feuermagier) (Ping timeout: 240 seconds)
05:36:09 Feuermagier joins (~Feuermagi@user/feuermagier)
05:40:37 × Feuermagier quits (~Feuermagi@user/feuermagier) (Ping timeout: 240 seconds)
05:42:49 Feuermagier joins (~Feuermagi@user/feuermagier)
05:43:20 rembo10 joins (~rembo10@static.133.56.108.65.clients.your-server.de)
05:47:52 × Feuermagier quits (~Feuermagi@user/feuermagier) (Ping timeout: 268 seconds)
05:50:30 qrpnxz parts (abc4f95c31@user/qrpnxz) (Disconnected: Replaced by new connection)
05:50:31 qrpnxz joins (abc4f95c31@user/qrpnxz)
05:52:48 × slowButPresent quits (~slowButPr@user/slowbutpresent) (Quit: leaving)
05:53:57 × merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 240 seconds)
05:57:07 × yauhsien quits (~yauhsien@118-167-43-174.dynamic-ip.hinet.net) (Read error: Connection reset by peer)
05:58:10 yauhsien joins (~yauhsien@118-167-43-174.dynamic-ip.hinet.net)
05:58:30 Feuermagier joins (~Feuermagi@user/feuermagier)
05:59:30 × [itchyjunk] quits (~itchyjunk@user/itchyjunk/x-7353470) (Read error: Connection reset by peer)
06:02:44 × Feuermagier quits (~Feuermagi@user/feuermagier) (Remote host closed the connection)
06:03:02 Feuermagier joins (~Feuermagi@user/feuermagier)
06:04:58 × Feuermagier quits (~Feuermagi@user/feuermagier) (Remote host closed the connection)
06:05:15 darkstardevx joins (~darkstard@50.39.115.145)
06:06:03 × deadmarshal quits (~deadmarsh@95.38.231.102) (Quit: ZNC 1.8.2 - https://znc.in)
06:06:16 × darkstardevx quits (~darkstard@50.39.115.145) (Remote host closed the connection)
06:06:27 deadmarshal joins (~deadmarsh@95.38.231.102)
06:06:40 darkstardevx joins (~darkstard@50.39.115.145)
06:08:34 × sprout quits (~quassel@2a02:a467:ccd6:1:bc5b:dbe0:79e5:a909) (Ping timeout: 260 seconds)
06:14:59 Feuermagier joins (~Feuermagi@user/feuermagier)
06:14:59 notzmv joins (~zmv@user/notzmv)
06:15:14 × rembo10 quits (~rembo10@static.133.56.108.65.clients.your-server.de) (Quit: ZNC 1.8.2 - https://znc.in)
06:16:17 rembo10 joins (~rembo10@2a01:4f9:c010:b5b9::1)
06:17:53 × Feuermagier quits (~Feuermagi@user/feuermagier) (Remote host closed the connection)
06:18:11 Feuermagier joins (~Feuermagi@user/feuermagier)
06:19:17 × Feuermagier quits (~Feuermagi@user/feuermagier) (Remote host closed the connection)
06:21:17 × Inst quits (~delicacie@2601:6c4:4080:3f80:e482:21a8:3024:fee0) (Ping timeout: 240 seconds)
06:21:59 × geekosaur quits (~geekosaur@xmonad/geekosaur) (Remote host closed the connection)
06:22:03 Feuermagier joins (~Feuermagi@user/feuermagier)
06:22:25 sprout joins (~quassel@2a02:a467:ccd6:1:bc5b:dbe0:79e5:a909)
06:23:29 chomwitt joins (~chomwitt@ppp-2-85-245-134.home.otenet.gr)
06:23:47 × Feuermagier quits (~Feuermagi@user/feuermagier) (Remote host closed the connection)
06:24:05 geekosaur joins (~geekosaur@xmonad/geekosaur)
06:25:11 aliosablack joins (~chomwitt@ppp-2-85-245-134.home.otenet.gr)
06:25:46 Feuermagier joins (~Feuermagi@user/feuermagier)
06:27:21 × sprout quits (~quassel@2a02:a467:ccd6:1:bc5b:dbe0:79e5:a909) (Ping timeout: 268 seconds)
06:30:26 × Feuermagier quits (~Feuermagi@user/feuermagier) (Ping timeout: 268 seconds)
06:32:39 takuan joins (~takuan@178-116-218-225.access.telenet.be)
06:34:15 Feuermagier joins (~Feuermagi@user/feuermagier)
06:35:47 × Feuermagier quits (~Feuermagi@user/feuermagier) (Remote host closed the connection)
06:36:33 Feuermagier joins (~Feuermagi@user/feuermagier)
06:37:54 <sim590> Here's the resulting solution for my problem http://ix.io/3JcO. I'm wondering if I could have done it as efficiently without a Map?
06:38:22 sprout joins (~quassel@2a02:a467:ccd6:1:bc5b:dbe0:79e5:a909)
06:38:23 × Feuermagier quits (~Feuermagi@user/feuermagier) (Remote host closed the connection)
06:38:27 jonathanx joins (~jonathan@94.234.52.89)
06:38:41 Feuermagier joins (~Feuermagi@user/feuermagier)
06:42:32 × sprout quits (~quassel@2a02:a467:ccd6:1:bc5b:dbe0:79e5:a909) (Ping timeout: 252 seconds)
06:42:37 × Feuermagier quits (~Feuermagi@user/feuermagier) (Ping timeout: 240 seconds)
06:44:41 <frumple_Doop> Haskell seems math centric, does it have ways of taking integrals, derivatives, and partial integrals/derivatives (calculus)?
06:45:21 <frumple_Doop> Or do those operations need to be user defined in a general way?
06:46:35 <frumple_Doop> ulterior motive to the question is, "is haskell a choice programming language for solving engineering problems, from Statics or for solving differential equations?"
06:47:23 sprout joins (~quassel@2a02:a467:ccd6:1:bc5b:dbe0:79e5:a909)
06:48:14 Feuermagier joins (~Feuermagi@user/feuermagier)
06:48:18 × xff0x quits (~xff0x@2001:1a81:52d0:e400:5fba:65e0:daae:59c3) (Ping timeout: 268 seconds)
06:49:04 xff0x joins (~xff0x@2001:1a81:52d0:e400:55eb:e48f:480a:9ef0)
06:49:04 × Feuermagier quits (~Feuermagi@user/feuermagier) (Remote host closed the connection)
06:50:47 Feuermagier joins (~Feuermagi@user/feuermagier)
06:52:01 <jackdk> frumple_Doop: I know about https://hackage.haskell.org/package/ad but haven't used it, dunno about integration
06:52:21 <jackdk> https://hackage.haskell.org/package/integration oh Ed's done that too
06:53:34 <frumple_Doop> oh I see, thanks.
06:55:32 × Feuermagier quits (~Feuermagi@user/feuermagier) (Ping timeout: 240 seconds)
07:02:14 _ht joins (~quassel@82-169-194-8.biz.kpn.net)
07:02:43 Morrow joins (~quassel@bzq-110-168-31-106.red.bezeqint.net)
07:05:37 × bu5hyt0p_ quits (~rmsare@2601:281:c780:a510:6d40:63c6:3a27:e5b8) (Ping timeout: 240 seconds)
07:05:51 <yin> cc
07:05:55 <yin> cc
07:05:57 <yin> OB
07:05:59 dhouthoo joins (~dhouthoo@178-117-36-167.access.telenet.be)
07:05:59 <yin> OB
07:06:49 Feuermagier joins (~Feuermagi@user/feuermagier)
07:07:56 × Feuermagier quits (~Feuermagi@user/feuermagier) (Remote host closed the connection)
07:08:17 frumple_Doop is now known as space_llama
07:17:41 Feuermagier joins (~Feuermagi@user/feuermagier)
07:20:29 × Feuermagier quits (~Feuermagi@user/feuermagier) (Remote host closed the connection)
07:22:53 <space_llama> > ('h':('a':['m']))
07:22:55 <lambdabot> "ham"
07:23:06 Feuermagier joins (~Feuermagi@user/feuermagier)
07:23:18 <space_llama> is "ham" syntactic sugar for: ('h':('a':['m'])) ?
07:24:50 <yin> ccººººººººººººººººººººººººººººººººººººººººººººººººººººººººººººººººººººººººººººººººººººººººººº++ççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççç
07:24:54 × Feuermagier quits (~Feuermagi@user/feuermagier) (Remote host closed the connection)
07:24:56 <yin> çççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççççç
07:25:02 <yin> çççççççççççççççççççççççççççççççççççççççççççç++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
07:25:08 <yin> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
07:25:14 <yin> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
07:25:20 <yin> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
07:25:26 <yin> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
07:25:32 <yin> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
07:25:38 <yin> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
07:25:44 <yin> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
07:25:50 <yin> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
07:25:53 <space_llama> > length' [] = 0; length' (_:xs) = 1 + length' xs
07:25:54 <lambdabot> <hint>:1:12: error: parse error on input ‘=’
07:25:56 <yin> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
07:26:02 <yin> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
07:26:08 <yin> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
07:26:14 <yin> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
07:26:20 <yin> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
07:26:25 <space_llama> yin fell asleep on keyboard; or cat...
07:26:26 <yin> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
07:26:32 <yin> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
07:26:38 <yin> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
07:26:42 <xerox> @ops
07:26:43 <lambdabot> Maybe you meant: pl oeis docs
07:26:44 <yin> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
07:26:46 <xerox> @where ops
07:26:46 <lambdabot> byorgey Cale conal copumpkin dcoutts dibblego dolio edwardk geekosaur glguy jmcarthur johnw mniip monochrom quicksilver shachaf shapr ski
07:26:47 synthmeat joins (~synthmeat@user/synthmeat)
07:26:50 <yin> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
07:26:56 <yin> +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++çççç++
07:28:10 ChanServ sets mode +o mniip
07:28:10 mniip sets mode +q-o *!*@user/zero mniip
07:32:27 Feuermagier joins (~Feuermagi@user/feuermagier)
07:32:37 × jonathanx quits (~jonathan@94.234.52.89) (Ping timeout: 256 seconds)
07:35:59 <space_llama> head (1,2,4)
07:36:05 <space_llama> > head (1,2,4)
07:36:06 <lambdabot> error:
07:36:06 <lambdabot> • Couldn't match expected type ‘[a]’
07:36:06 <lambdabot> with actual type ‘(a0, b0, c0)’
07:36:20 <space_llama> > head "1 2 3 4"
07:36:22 <lambdabot> '1'
07:36:29 <space_llama> > tail "1 2 3 4"
07:36:31 <lambdabot> " 2 3 4"
07:36:46 × Feuermagier quits (~Feuermagi@user/feuermagier) (Ping timeout: 260 seconds)
07:39:24 Feuermagier joins (~Feuermagi@user/feuermagier)
07:40:36 tromp joins (~textual@dhcp-077-249-230-040.chello.nl)
07:43:45 <Cale> space_llama: Yes, it is, and ['m'] is syntactic sugar for 'm':[]
07:44:14 × Feuermagier quits (~Feuermagi@user/feuermagier) (Ping timeout: 260 seconds)
07:46:26 <space_llama> > ['m'] == "m"
07:46:27 <lambdabot> True
07:46:58 <space_llama> llama == space
07:47:03 <space_llama> > llama == space
07:47:04 <lambdabot> error: Variable not in scope: llama :: Doc
07:47:12 <space_llama> :(
07:49:11 <space_llama> > "word" == 'w':('o':('r':"d"))
07:49:12 <lambdabot> True
07:50:36 merijn joins (~merijn@83-160-49-249.ip.xs4all.nl)
07:51:09 ChanServ sets mode +o mniip
07:51:10 mniip sets mode -q *!*@user/zero
07:51:49 mniip sets mode -o mniip
07:52:11 Feuermagier joins (~Feuermagi@user/feuermagier)
07:53:42 × albet70 quits (~xxx@2400:8902::f03c:92ff:fe60:98d8) (Remote host closed the connection)
07:56:47 × Feuermagier quits (~Feuermagi@user/feuermagier) (Ping timeout: 252 seconds)
07:59:49 albet70 joins (~xxx@2400:8902::f03c:92ff:fe60:98d8)
08:01:19 Tuplanolla joins (~Tuplanoll@91-159-69-214.elisa-laajakaista.fi)
08:03:47 Feuermagier joins (~Feuermagi@user/feuermagier)
08:04:11 × Feuermagier quits (~Feuermagi@user/feuermagier) (Remote host closed the connection)
08:06:11 <EvanR> interesting
08:06:28 <EvanR> I have a datatype with 11 fields
08:06:41 Feuermagier joins (~Feuermagi@user/feuermagier)
08:06:42 <EvanR> the more of them I make strict, the longer compiling -O2 takes
08:06:57 <EvanR> I noticed because if they are all strict, compiling seems to take forever
08:07:04 × Feuermagier quits (~Feuermagi@user/feuermagier) (Remote host closed the connection)
08:10:22 Feuermagier joins (~Feuermagi@user/feuermagier)
08:13:53 mattil joins (~mattil@helsinki.portalify.com)
08:15:46 xkuru joins (~xkuru@user/xkuru)
08:16:37 × deadmarshal quits (~deadmarsh@95.38.231.102) (Ping timeout: 240 seconds)
08:16:49 × econo quits (uid147250@user/econo) (Quit: Connection closed for inactivity)
08:17:09 Sobhan joins (~Sobhan@modemcable039.128-131-66.mc.videotron.ca)
08:18:16 <Sobhan> Hi, what would be my best best evaluating a function like map (\i -> sum $ map (\j -> sum $ map (\k -> bool 0 1 (pred i j k)) [0..1000]) [0.1000]) [0..1000]
08:18:32 × Feuermagier quits (~Feuermagi@user/feuermagier) (Remote host closed the connection)
08:18:48 thebnq joins (~bnq@herrokitty.com)
08:18:50 Feuermagier joins (~Feuermagi@user/feuermagier)
08:18:50 <Sobhan> it fills up my ram, i'm guessing i'm not using lazy evaluation properly
08:21:33 × Feuermagier quits (~Feuermagi@user/feuermagier) (Remote host closed the connection)
08:21:50 Feuermagier joins (~Feuermagi@user/feuermagier)
08:22:49 <pavonia> I think sum is too lazy here
08:22:58 <pavonia> @src sum
08:22:58 <lambdabot> sum = foldl (+) 0
08:23:03 × Feuermagier quits (~Feuermagi@user/feuermagier) (Remote host closed the connection)
08:23:09 <Sobhan> so foldl'?
08:23:16 deadmarshal joins (~deadmarsh@95.38.231.102)
08:23:28 <pavonia> Yeah, try sum' = foldl' (+) 0
08:24:22 × waleee quits (~waleee@2001:9b0:21d:fc00:398f:b003:b90d:acf4) (Ping timeout: 260 seconds)
08:24:27 <xsperry> I believe when you're compiling with (with -O2 at least) sum shouldn't create unnecessary thunks
08:24:35 <Hecate> sum :: Num a => t a -> a
08:24:35 <Hecate> sum = getSum #. foldMap' Sum
08:24:37 × merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 240 seconds)
08:24:40 <Hecate> in base 4.16
08:24:54 <Hecate> but *not* in base 4.14 !
08:24:55 <Sobhan> i was testing with O2 and this fixed it
08:25:05 <Hecate> Sobhan: yes, so, there's a bit of history behind that
08:25:07 <Sobhan> thanks
08:25:12 <Hecate> (I'm the one who pushed the change to base)
08:25:20 <Sobhan> (nice)
08:25:29 <Hecate> (thanks, it was unnecessarily painful)
08:25:30 <Hecate> so
08:25:51 <Hecate> for all intent and purpose, the laziness of sum/product disappears once you start putting O1 and above
08:25:57 <Hecate> it's optimised away
08:26:00 waleee joins (~waleee@2001:9b0:21d:fc00:398f:b003:b90d:acf4)
08:26:13 <Hecate> but with ghci, it's still here!
08:26:21 <Hecate> (unless you specify an optimisation level by hand)
08:26:49 Feuermagier joins (~Feuermagi@user/feuermagier)
08:26:52 <Hecate> which means that trying out functions in ghci doesn't produce the same outcome in terms of memory consumption and evaluation eagerness/laziness
08:27:10 <Hecate> compared to writing it down in a file and using the optimisation levels
08:27:53 <Hecate> what was fixed in the base library was the default behaviour to be always eager evaluation
08:28:20 gehmehgeh joins (~user@user/gehmehgeh)
08:28:30 × Feuermagier quits (~Feuermagi@user/feuermagier) (Remote host closed the connection)
08:28:33 <Sobhan> i wasn't testing in ghci tho, i was compiling with -O2
08:29:03 <Hecate> and from what I can read, it fixed it?
08:29:19 <Sobhan> `sum' = foldl' (+) 0` fixed itr
08:29:30 <Hecate> ah great :)
08:29:55 <EvanR> moral of the story is you want a foldl' to do a sum
08:30:08 <EvanR> how you get there is another story
08:30:26 <EvanR> that it depends on optimizations seems weird
08:30:45 <Hecate> EvanR: unfortunately it is not
08:30:57 <Hecate> I admit it feels weird
08:31:31 <Sobhan> my inner "loop" still does 75% of the allocations tho
08:31:32 <Hecate> but when I advocated for the change in base, I had very angry people from universities telling me "noooo, Haskell is a lazy language, you're destroying decades of intuition and teaching, noooooo"
08:32:34 <Hecate> if you want to see how it went, read the "[Proposal]" thread of October 2020: https://mail.haskell.org/pipermail/libraries/2020-October/thread.html#start
08:32:34 <Sobhan> :rofl:
08:32:40 Feuermagier joins (~Feuermagi@user/feuermagier)
08:33:09 <Hecate> especially fucking KKK grand wizard David Duke, what a terrible participant in all this :')
08:33:13 <Sobhan>      dumbSol.kf                             Main                    src/Main.hs:69:5-93                            2064        9504    2.8   71.1    57.5   86.9      dumbSol.kf.\                          Main
08:33:13 <Sobhan> src/Main.hs:69:32-71                           2066      950400    0.8   15.9    54.6   15.9
08:33:19 <EvanR> what
08:33:26 <Hecate> https://mail.haskell.org/pipermail/libraries/2020-October/030877.html
08:33:47 <Hecate> EvanR: David J Duke of the Haskell community shares his name with a famous KKK grand wizard
08:33:59 <EvanR> ok not actual david duke
08:34:05 <Hecate> ;'D
08:34:13 <Sobhan> kf is my "inner" loop
08:34:27 <Sobhan> is doing that many allocation normal?
08:34:28 × Feuermagier quits (~Feuermagi@user/feuermagier) (Remote host closed the connection)
08:34:32 <EvanR> your inner loop doing most of the work, activity, whatever, makes sense ot me
08:34:35 kuribas joins (~user@ptr-25vy0i8krrkad5xv3l1.18120a2.ip6.access.telenet.be)
08:34:37 × zmt01 quits (~zmt00@user/zmt00) (Ping timeout: 240 seconds)
08:35:32 Feuermagier joins (~Feuermagi@user/feuermagier)
08:35:35 <EvanR> allocation happens as a matter of course behind the scenes in haskell, but you shouldn't think of it like calling malloc
08:36:26 <Hecate> Sobhan: oh dear, don't pay too much attention to the allocation, the RTS allocates and the GC eats memory at very high speeds
08:37:01 <Hecate> I remember hearing about something 80+GB/s on systems that definitely do not have 80+GB of RAM ;-D
08:38:16 <dminuoso> Sobhan: Allocations are bad if they are your bottleneck.
08:38:31 <EvanR> this post is pretty terrible
08:38:38 <dminuoso> Sobhan: Note, that fusion is one of those optimizations designed to avoid intermediate/unneeded allocations.
08:38:49 <dminuoso> But its only really relevant if thats your bottleneck.
08:40:32 <Hecate> EvanR: the mailling-list email? yeah it's pretty terrible
08:41:07 <EvanR> someone was suggesting making foldMap (not-prime) strict?
08:41:26 <Hecate> no
08:41:36 <EvanR> ok then
08:41:46 <Hecate> Fumiaki doesn't take any shit
08:41:47 <Hecate> https://mail.haskell.org/pipermail/libraries/2020-October/030879.html
08:42:23 × Feuermagier quits (~Feuermagi@user/feuermagier) (Ping timeout: 268 seconds)
08:45:24 <int-e> I'd hope the GC would reclaim memory, not eat it :)
08:46:01 merijn joins (~merijn@83-160-49-249.ip.xs4all.nl)
08:47:16 <Hecate> int-e: :P I tried to go with metaphores
08:47:23 <dminuoso> int-e: Hah, in reality the GC is just pac man.
08:47:42 × coot quits (~coot@2a02:a310:e03f:8500:5cc8:47c:8ec0:b827) (Quit: coot)
08:47:53 neurocyte0132889 joins (~neurocyte@94.46.68.154)
08:47:53 × neurocyte0132889 quits (~neurocyte@94.46.68.154) (Changing host)
08:47:53 neurocyte0132889 joins (~neurocyte@user/neurocyte)
08:48:28 <space_llama> what is meant by "pipes" in haskell lingo?
08:48:53 <Hecate> space_llama: the library
08:49:04 Feuermagier joins (~Feuermagi@user/feuermagier)
08:49:04 <Hecate> or someone is just fond of plumbing
08:49:24 <dminuoso> space_llama: This refers to a library or ideas of pipes, much in the same sense how we can use `|` in shell languages to construct data processing pipelines.
08:49:26 <space_llama> such as "Guards are indicated by pipes that follow a function's name and its parameters." from learn you a haskell
08:49:31 <dminuoso> Ah
08:49:35 <int-e> that's just the symbol |
08:49:35 <dminuoso> Just the character |
08:49:49 <space_llama> oh I see
08:49:52 <dminuoso> Incidentally because in shell languages this lets you create "pipes" to connect stuff together
08:50:01 <Hecate> yes
08:50:03 <dminuoso> Which is also why the library `pipes` is called `pipes` :)
08:50:03 <Hecate> sorry space_llama :D
08:50:33 <dminuoso> space_llama: Fun fact, in conduit the operator to connect two conduits is also named .| :)
08:50:57 × Feuermagier quits (~Feuermagi@user/feuermagier) (Remote host closed the connection)
08:51:13 lavaman joins (~lavaman@98.38.249.169)
08:51:14 Feuermagier joins (~Feuermagi@user/feuermagier)
08:51:35 <space_llama> in math its called vertical bar
08:51:53 <space_llama> which incidentally is space llamas favorite place to get a drink
08:52:10 <space_llama> :|
08:52:35 acidjnk joins (~acidjnk@p200300d0c7271e77d154eb1f1200bcdb.dip0.t-ipconnect.de)
08:53:06 × nuh^ quits (~nuh@64.253.22.77) (Remote host closed the connection)
08:54:07 <space_llama> diminuoso https://www.conduitlanguage.com/ ?
08:54:58 × ChaiTRex quits (~ChaiTRex@user/chaitrex) (Remote host closed the connection)
08:54:58 × Sgeo quits (~Sgeo@user/sgeo) (Read error: Connection reset by peer)
08:55:31 × mncheck quits (~mncheck@193.224.205.254) (Remote host closed the connection)
08:55:46 × Feuermagier quits (~Feuermagi@user/feuermagier) (Ping timeout: 245 seconds)
08:55:55 × lavaman quits (~lavaman@98.38.249.169) (Ping timeout: 256 seconds)
08:55:57 × neurocyte0132889 quits (~neurocyte@user/neurocyte) (Ping timeout: 268 seconds)
08:56:28 ChaiTRex joins (~ChaiTRex@user/chaitrex)
08:56:56 <dminuoso> Yes, that...
08:57:03 <dminuoso> I dont even. :(
08:57:11 × eggplantade quits (~Eggplanta@2600:1700:bef1:5e10:319d:53ed:6690:e5b4) (Remote host closed the connection)
08:57:46 mncheck joins (~mncheck@193.224.205.254)
08:58:16 Feuermagier joins (~Feuermagi@user/feuermagier)
08:59:48 × Feuermagier quits (~Feuermagi@user/feuermagier) (Remote host closed the connection)
09:00:06 Feuermagier joins (~Feuermagi@user/feuermagier)
09:02:15 Gurkenglas joins (~Gurkengla@dslb-002-203-144-204.002.203.pools.vodafone-ip.de)
09:03:38 falafel_ joins (~falafel@cpe-76-168-195-162.socal.res.rr.com)
09:05:25 epolanski joins (uid312403@id-312403.helmsley.irccloud.com)
09:06:11 × Feuermagier quits (~Feuermagi@user/feuermagier) (Remote host closed the connection)
09:06:13 jonathanx joins (~jonathan@c-5eea3459-74736162.cust.telenor.se)
09:06:26 × pavonia quits (~user@user/siracusa) (Quit: Bye!)
09:09:10 Feuermagier joins (~Feuermagi@user/feuermagier)
09:10:52 × Feuermagier quits (~Feuermagi@user/feuermagier) (Remote host closed the connection)
09:12:00 × yauhsien quits (~yauhsien@118-167-43-174.dynamic-ip.hinet.net) (Remote host closed the connection)
09:12:46 yauhsien joins (~yauhsien@118-167-43-174.dynamic-ip.hinet.net)
09:13:03 <carbolymer> Can I have two default signatures using DefaultSignatures?
09:14:26 <carbolymer> for the same function
09:17:06 Feuermagier joins (~Feuermagi@user/feuermagier)
09:17:24 × geekosaur quits (~geekosaur@xmonad/geekosaur) (Remote host closed the connection)
09:17:25 × yauhsien quits (~yauhsien@118-167-43-174.dynamic-ip.hinet.net) (Ping timeout: 240 seconds)
09:17:49 geekosaur joins (~geekosaur@xmonad/geekosaur)
09:18:28 × Feuermagier quits (~Feuermagi@user/feuermagier) (Remote host closed the connection)
09:18:38 <dminuoso> carbolymer: What would that even mean?
09:18:46 Feuermagier joins (~Feuermagi@user/feuermagier)
09:19:11 yauhsien joins (~yauhsien@118-167-43-174.dynamic-ip.hinet.net)
09:19:14 <carbolymer> dminuoso: two default signatures with exclusive constraints
09:19:46 <dminuoso> And how should GHC decide to pick?
09:20:19 <carbolymer> dminuoso: if the constraints are exclusive, isn't that obvious?
09:20:34 <dminuoso> No?
09:20:48 × space_llama quits (~Guest|47@c-73-221-44-172.hsd1.wa.comcast.net) (Quit: Connection closed)
09:20:53 <dminuoso> First, how would GHC even know that they are exclusive
09:21:00 <carbolymer> I mean, GHC could fail with an error if it can't pick...
09:21:36 <zero> theoretically, couldn't we have a (data Strict a = Strict !a) that would make any type behave strictly? where for example, replacing (Int) with (Strict Int) in type signatures would make it an instance of a Num' class which would be a strict version of Num
09:21:42 <dminuoso> Or do you mean exclusive in the sense that only one can be satisfied, and you expect GHC to just try out both?
09:21:52 <dminuoso> For each instance?
09:22:25 otherwise joins (~otherwise@c-73-221-44-172.hsd1.wa.comcast.net)
09:22:27 <carbolymer> dminuoso: yes, try each one, select the one which matches ; if both match, fail with an error
09:22:57 <dminuoso> carbolymer: Okay so the answer is simple: the manual lists no such behavior https://ghc.gitlab.haskell.org/ghc/doc/users_guide/exts/default_signatures.html
09:23:38 <carbolymer> dminuoso: yeah, but the manual does not say 'no' also, so I was hoping I could do that...
09:23:40 <carbolymer> Well
09:23:58 <dminuoso> I guess exlusivity doesn't matter, it would rather be a "go from top-to-bottom, pick first that works")
09:24:20 × Feuermagier quits (~Feuermagi@user/feuermagier) (Ping timeout: 268 seconds)
09:24:20 <dminuoso> Well, the manual also doesn't state that `class Jinxed class Thing` is illegal.
09:24:32 <dminuoso> Do you expect the GHC manual to explicitly list all the things that you cant do?
09:24:48 <carbolymer> dminuoso: sometimes it's not obvious what are the limits
09:25:02 <dminuoso> Im not entirely sure why you expect this to work in the first place
09:25:57 × Akiva quits (~Akiva@user/Akiva) (Ping timeout: 240 seconds)
09:26:17 Inst joins (~delicacie@2601:6c4:4080:3f80:f9a0:f50b:a310:4e7)
09:26:30 <Inst> maybe this is Haskell-offtopic, but is Haskell more Hermione Granger or Luna Lovegood?
09:26:48 coolnickname joins (uid531864@user/coolnickname)
09:26:50 <carbolymer> dminuoso: i don't really know why it can't work
09:26:59 <dminuoso> carbolymer: Im not saying it couldn't.
09:27:07 <dminuoso> Im just saying it doesn't seem like an obvious thing to want.
09:27:16 <dminuoso> Arguably Id find this extremely unintuitive
09:27:25 <dminuoso> Consider: You write `instance Foo Bar`. What does this do?
09:27:30 <dminuoso> Which implementation does it pick?
09:27:50 <dminuoso> If you have some subtle bugs, this can alter behavior without you even noticing
09:27:55 <carbolymer> dminuoso: the best option here would be to fail with an error if more than one matches I think
09:28:19 <dminuoso> carbolymer: still, its completely unintuitive because you cant see what is being done.
09:28:32 <dminuoso> You have to play constraint resolution in your head to know which default method would be picked
09:29:01 <dminuoso> Each time you change either the default constraints of your Foo, or instances on Bar.
09:29:11 <carbolymer> dminuoso: this now make more sense if you phrase it that way
09:30:26 qrpnxz parts (abc4f95c31@user/qrpnxz) (Disconnected: Replaced by new connection)
09:30:26 qrpnxz joins (abc4f95c31@user/qrpnxz)
09:30:55 qrpnxz parts (abc4f95c31@user/qrpnxz) (Disconnected: closed)
09:31:05 qrpnxz joins (abc4f95c31@user/qrpnxz)
09:31:50 cosimone joins (~user@93-34-133-112.ip49.fastwebnet.it)
09:32:01 briandaed joins (~root@185.234.208.208.r.toneticgroup.pl)
09:32:49 <carbolymer> Well so I'm resorted to building a tower of monads then
09:35:46 × ozzloy quits (~ozzloy@ozzloy.lifeafterking.org) (Ping timeout: 245 seconds)
09:36:11 Feuermagier joins (~Feuermagi@user/feuermagier)
09:37:06 <yin> i wonder if writing a filter like this can negatively impact performance.
09:37:08 <yin> length [ () | (0,_) <- M.keys g ]
09:37:50 meer joins (~delicacie@2601:6c4:4080:3f80:d9cb:b805:baaa:394f)
09:38:21 × Feuermagier quits (~Feuermagi@user/feuermagier) (Remote host closed the connection)
09:38:43 <zero> yin: as opposed to what?
09:39:57 × Inst quits (~delicacie@2601:6c4:4080:3f80:f9a0:f50b:a310:4e7) (Ping timeout: 240 seconds)
09:40:01 <yin> something like `length $ filter ((== 0) . fst) $ M.keys g`
09:40:15 Feuermagier joins (~Feuermagi@user/feuermagier)
09:43:00 <zero> length . filter is subject to fusion I think, maybe someone can confirm. not sure about your [()] thing
09:44:16 meer is now known as Inst
09:44:26 jgeerds joins (~jgeerds@55d4ac73.access.ecotel.net)
09:44:50 × mattil quits (~mattil@helsinki.portalify.com) (Remote host closed the connection)
09:45:06 × Feuermagier quits (~Feuermagi@user/feuermagier) (Ping timeout: 260 seconds)
09:45:30 × tzh quits (~tzh@c-24-21-73-154.hsd1.wa.comcast.net) (Quit: zzz)
09:49:01 <yin> (i want to apologise for earlier. that was definitely my cat)
09:49:22 <yin> (just noticed it)
09:51:09 <yin> EvanR: how is that an infinite list?
09:52:40 Akiva joins (~Akiva@user/Akiva)
09:53:11 × otherwise quits (~otherwise@c-73-221-44-172.hsd1.wa.comcast.net) (Quit: Connection closed)
09:57:40 eggplantade joins (~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net)
09:58:09 <dminuoso> tomsmeding: By the way, recall this domain trie problem?
09:58:27 <dminuoso> It's so bizarre how problems keep reappearing all around you once you think about it.
09:58:37 × merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 240 seconds)
10:01:57 × eggplantade quits (~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net) (Ping timeout: 240 seconds)
10:02:57 dsrt^ joins (~dsrt@64.253.22.77)
10:05:20 Feuermagier joins (~Feuermagi@user/feuermagier)
10:05:54 × jonathanx quits (~jonathan@c-5eea3459-74736162.cust.telenor.se) (Read error: Connection reset by peer)
10:06:11 × Feuermagier quits (~Feuermagi@user/feuermagier) (Remote host closed the connection)
10:06:12 jonathanx joins (~jonathan@c-5eea3459-74736162.cust.telenor.se)
10:07:54 × yauhsien quits (~yauhsien@118-167-43-174.dynamic-ip.hinet.net) (Remote host closed the connection)
10:08:39 yauhsien joins (~yauhsien@118-167-43-174.dynamic-ip.hinet.net)
10:09:16 <xerox> yin: also M.size (M.filter pred m)
10:09:28 × jonathanx quits (~jonathan@c-5eea3459-74736162.cust.telenor.se) (Remote host closed the connection)
10:09:46 jonathanx joins (~jonathan@c-5eea3459-74736162.cust.telenor.se)
10:10:21 Feuermagier joins (~Feuermagi@user/feuermagier)
10:11:57 × mvk quits (~mvk@2607:fea8:5cdd:f000::917a) (Ping timeout: 240 seconds)
10:13:33 × yauhsien quits (~yauhsien@118-167-43-174.dynamic-ip.hinet.net) (Ping timeout: 256 seconds)
10:13:37 coot joins (~coot@89-64-85-93.dynamic.chello.pl)
10:13:46 × hololeap quits (~hololeap@user/hololeap) (Excess Flood)
10:15:04 hololeap joins (~hololeap@user/hololeap)
10:15:37 × jonathanx quits (~jonathan@c-5eea3459-74736162.cust.telenor.se) (Ping timeout: 240 seconds)
10:16:40 <yin> xerox: what's that?
10:16:42 <c_wraith> xerox:
10:16:52 <c_wraith> I don't think that's gonna work as nicely
10:17:03 <c_wraith> because filtering a Map is a complex operation
10:17:09 <c_wraith> no way that'll fuse
10:17:31 <dminuoso> Filtering a map will reconstruct a new map, rebalancing it with each element
10:17:57 <dminuoso> Right?
10:18:05 <xerox> my thought would be that if I use the library's functions I give them a chance to do internal optimizations that would not survive the boundaries of changing data structure
10:18:25 <dminuoso> Though containers claims filter to be O(n) mmm
10:18:35 <c_wraith> It probably goes through an intermediate list
10:18:45 <c_wraith> to a list, filter, reconstruct from a sorted list
10:18:50 <c_wraith> that's all O(n)
10:19:04 <c_wraith> and obviously more work than just going to a list and filtering and not reconstructing
10:19:06 <dminuoso> No it does not
10:19:15 <yin> notice how i'm just interested in the keys
10:19:16 <dminuoso> It directly operates on Map
10:19:35 <dminuoso> I dont understand how this can be O(n)(
10:20:15 <c_wraith> well, it's not a typical balanced tree. It's allowed to get pretty far out of balance.
10:20:48 <c_wraith> maybe that means it only does O(1) rebalances in the process of deleting an arbitrary number of elements
10:20:50 <yin> so... is import Data.Set as S hiding ( take )
10:20:53 <xerox> so I guess M.filterWithKeys would be the correct one to have mentioned
10:21:03 <yin> ooops sorry about that
10:21:12 <c_wraith> yin: you probably want a qualified in there
10:21:13 <xerox> there's also S.size (S.filter pred (M.keysSet m))
10:21:29 × Lord_of_Life quits (~Lord@user/lord-of-life/x-2819915) (Ping timeout: 256 seconds)
10:21:39 <c_wraith> yin: then you don't need to hide anything
10:21:39 <int-e> c_wraith: note that even fromAscList . filter . toAscList would be O(n)
10:21:43 <yin> c_wraith: yeah
10:21:50 <c_wraith> int-e: yes, that was my point
10:22:09 Lord_of_Life joins (~Lord@user/lord-of-life/x-2819915)
10:22:22 <int-e> but regardless, if all you want is to count, yes, length . filter . toList is the way to go
10:22:38 <c_wraith> there's no way it's more efficient to reconstruct a complex data structure
10:22:44 <c_wraith> and then throw it out
10:23:09 <yin> so `length [ () | (0,_) <- M.keys g ]` is not that smart, is what i'm hearing
10:23:18 <c_wraith> nah, it's good
10:23:36 <dminuoso> c_wraith: Maybe Im misreading the implementation, but doesn't filterWithKey potentially call `link2`, which potentially rebalances one side?
10:23:45 <dminuoso> https://hackage.haskell.org/package/containers-0.6.5.1/docs/src/Data.Map.Internal.html#filterWithKey
10:24:25 <int-e> even if it constructs an intermediate list (which I think it avoids; there's a rule toAscList m = build (\c n -> foldrFB (\k x xs -> c (k,x) xs) n m)
10:24:39 <int-e> ...so build/foldr fusion should kick in)
10:24:51 <xerox> this is nice to know
10:24:58 <c_wraith> dminuoso: yes, but that's sort of beside the point. To understand the bound, you'd need to look at the number of rebalances required over the entire process, not the worst case multiplied by each place it could happen
10:25:40 <xerox> all these functions are defined via foldrWithKey
10:25:52 <yin> @hoogle foldrFB
10:25:52 <lambdabot> Data.Massiv.Array foldrFB :: Source r ix e => (e -> b -> b) -> b -> Array r ix e -> b
10:26:50 <dminuoso> c_wraith: Ah I get your point.
10:26:57 <int-e> yin: https://hackage.haskell.org/package/containers-0.6.5.1/docs/src/Data.Map.Internal.html#foldrFB
10:27:12 <yin> int-e: thank
10:27:19 <dminuoso> Either way, it looks fairly obvious that using filterWithKey is *not* going to perform well
10:27:23 <dminuoso> For this task.
10:27:34 <c_wraith> Yeah. It's great when you still want a Map afterwards
10:27:45 <c_wraith> But when you just want a list, not so much
10:33:45 dextaa5 joins (~DV@user/dextaa)
10:34:19 × dextaa quits (~DV@user/dextaa) (Ping timeout: 265 seconds)
10:35:50 zangi joins (~zangi@103.154.230.133)
10:37:59 <zangi> is there a builtin function that can generate every single combinations of a list based on the length?
10:38:06 <zangi> > filter ((==3) . length) $ Data.List.subsequences [1..4]
10:38:07 <lambdabot> [[1,2,3],[1,2,4],[1,3,4],[2,3,4]]
10:38:46 <zangi> Data.List.subsequences doesn't really produce every single combination, i.e. it's missing [3,1,4]
10:38:47 <int-e> zangi: now do it for a list with 30 elements
10:39:10 <int-e> > permutations [1,2,3]
10:39:12 <lambdabot> [[1,2,3],[2,1,3],[3,2,1],[2,3,1],[3,1,2],[1,3,2]]
10:40:04 <int-e> a subsequence of a_1..a_n is a_{i_1}...a_{i_k} where 1 <= i_1 < i_2 < ... < i_k <= n.
10:40:14 <c_wraith> > replicateM 3 [1..5]
10:40:14 <int-e> so [3,1,4] is not a subsequence of [1,2,3,4]
10:40:15 <lambdabot> [[1,1,1],[1,1,2],[1,1,3],[1,1,4],[1,1,5],[1,2,1],[1,2,2],[1,2,3],[1,2,4],[1,...
10:40:33 <c_wraith> there are all sorts of things you might mean
10:41:10 <int-e> > subsequences [1..2] >>= permutations
10:41:11 <lambdabot> [[],[1],[2],[1,2],[2,1]]
10:42:04 max22- joins (~maxime@2a01cb088335980010d18673f284ce01.ipv6.abo.wanadoo.fr)
10:42:26 × Feuermagier quits (~Feuermagi@user/feuermagier) (Ping timeout: 245 seconds)
10:46:18 jonathanx joins (~jonathan@94.234.52.89)
10:47:43 <dminuoso> I have a `Map K V`, and I want to essentially partition the entire map into some `Map O (Map K V)` by means of a `part :: K -> O`. Do I have to build this myself, or are there primitives in `containers` that might help?
10:48:37 <dminuoso> Naively I'd use `toAscList`, groupOn, and then run a nested fromAscList
10:49:23 yauhsien joins (~yauhsien@118-167-43-174.dynamic-ip.hinet.net)
10:52:03 Feuermagier joins (~Feuermagi@user/feuermagier)
10:56:17 × Feuermagier quits (~Feuermagi@user/feuermagier) (Ping timeout: 240 seconds)
10:56:29 × jespada quits (~jespada@87.74.33.157) (Ping timeout: 250 seconds)
10:57:10 × yauhsien quits (~yauhsien@118-167-43-174.dynamic-ip.hinet.net) (Remote host closed the connection)
10:58:19 jespada joins (~jespada@87.74.33.157)
10:59:23 eggplantade joins (~Eggplanta@2600:1700:bef1:5e10:319d:53ed:6690:e5b4)
11:00:34 burnsidesLlama joins (~burnsides@dhcp168-011.wadham.ox.ac.uk)
11:02:32 yauhsien joins (~yauhsien@118-167-43-174.dynamic-ip.hinet.net)
11:03:37 × eggplantade quits (~Eggplanta@2600:1700:bef1:5e10:319d:53ed:6690:e5b4) (Ping timeout: 240 seconds)
11:06:15 × ishutin quits (~ishutin@78-131-74-101.pool.digikabel.hu) (Ping timeout: 256 seconds)
11:06:57 × yauhsien quits (~yauhsien@118-167-43-174.dynamic-ip.hinet.net) (Ping timeout: 240 seconds)
11:07:47 ishutin joins (~ishutin@80-95-82-198.pool.digikabel.hu)
11:08:05 Feuermagier joins (~Feuermagi@user/feuermagier)
11:08:55 neceve joins (~quassel@2.26.93.228)
11:10:49 <zero> what is this:
11:10:50 <zero> Suffix occurrence of @. For an as-pattern, remove the leading whitespace.
11:10:50 <zero> |
11:10:50 <zero> 47 | go m cave@ ~(c:_)
11:10:50 <zero> | ^
11:10:52 <zero> ?
11:10:57 × jonathanx quits (~jonathan@94.234.52.89) (Ping timeout: 240 seconds)
11:11:47 <zero> is this a new 9.2 thing?
11:12:02 machinedgod joins (~machinedg@24.105.81.50)
11:12:13 <xerox> which part?
11:12:15 × Vajb quits (~Vajb@hag-jnsbng11-58c3a8-176.dhcp.inet.fi) (Read error: Connection reset by peer)
11:12:22 <zero> the error
11:12:49 <zero> never had this error before
11:13:00 Vajb joins (~Vajb@hag-jnsbng11-58c3a8-176.dhcp.inet.fi)
11:13:11 <mjrosenb> leading whitespace? not trailing whitespace?
11:15:24 <zero> this is how an as pattern irrefutable is supposed to be written, isn't it?
11:15:26 × lambdabot quits (~lambdabot@haskell/bot/lambdabot) (Quit: let me try something)
11:16:46 <zero> the space in `as@ ~pat` is necessary because otherwise `@~` would be parsed as a unique symbol
11:16:50 <zero> right?
11:16:52 <xerox> you need parens
11:16:54 <zero> what am i missing?
11:17:02 <xerox> x@(~(...))
11:17:10 <zero> since when?
11:17:34 <xerox> spaces are for different arguments no?
11:17:52 lambdabot joins (~lambdabot@silicon.int-e.eu)
11:17:52 × lambdabot quits (~lambdabot@silicon.int-e.eu) (Changing host)
11:17:52 lambdabot joins (~lambdabot@haskell/bot/lambdabot)
11:18:45 <zero> never had this problem before
11:18:55 <zero> but parens work. thanks
11:24:41 × lambdabot quits (~lambdabot@haskell/bot/lambdabot) (Quit: tum tee tum)
11:24:49 lambdabot joins (~lambdabot@haskell/bot/lambdabot)
11:25:20 yauhsien joins (~yauhsien@118-167-43-174.dynamic-ip.hinet.net)
11:27:53 × lambdabot quits (~lambdabot@haskell/bot/lambdabot) (Client Quit)
11:28:14 lambdabot joins (~lambdabot@haskell/bot/lambdabot)
11:29:56 × lambdabot quits (~lambdabot@haskell/bot/lambdabot) (Client Quit)
11:30:06 lambdabot joins (~lambdabot@silicon.int-e.eu)
11:30:06 × lambdabot quits (~lambdabot@silicon.int-e.eu) (Changing host)
11:30:06 lambdabot joins (~lambdabot@haskell/bot/lambdabot)
11:30:55 <int-e> > let splitFst = unfoldr (\m -> M.minViewWithKey m >>= \(((k, _),_), _) -> let (m1, m2) = spanAntitone ((<= k) . fst) m in pure ((k, mapKeysMonotonic snd m1), m2)) in splitFst $ M.fromList [((1,2),3),((1,3),2),((2,0),4)]
11:31:04 <lambdabot> error:
11:31:10 <lambdabot> • Variable not in scope:
11:31:27 <int-e> of course.
11:31:43 <int-e> > let splitFst = unfoldr (\m -> M.minViewWithKey m >>= \(((k, _),_), _) -> let (m1, m2) = M.spanAntitone ((<= k) . fst) m in pure ((k, mapKeysMonotonic snd m1), m2)) in splitFst $ M.fromList [((1,2),3),((1,3),2),((2,0),4)]
11:31:44 <lambdabot> error:
11:31:44 <lambdabot> • Variable not in scope:
11:31:44 <lambdabot> mapKeysMonotonic :: ((a1, b1) -> b1) -> M.Map (a2, b2) a3 -> b3
11:32:07 <int-e> > let splitFst = unfoldr (\m -> M.minViewWithKey m >>= \(((k, _),_), _) -> let (m1, m2) = M.spanAntitone ((<= k) . fst) m in pure ((k, M.mapKeysMonotonic snd m1), m2)) in splitFst $ M.fromList [((1,2),3),((1,3),2),((2,0),4)]
11:32:09 <lambdabot> [(1,fromList [(2,3),(3,2)]),(2,fromList [(0,4)])]
11:33:04 <int-e> dminuoso: this /may/ be better than the naive thing, mainly if the groups are large.
11:33:39 <int-e> dminuoso: spanAntitone is from Data.Map.Internal though
11:34:48 <int-e> and the lambdabot noise was me fixing @let... I didn't realize I broke it with my last experiment maybe a week ago.
11:35:32 <dminuoso> int-e: Mmm, that looks neat.
11:37:11 × Guest2359 quits (1000@gabilgathol.bandrate.org) (Changing host)
11:37:11 Guest2359 joins (1000@sourcemage/mage/beowulf)
11:37:17 Guest2359 is now known as |beowulf|
11:45:17 qrpnxz parts (abc4f95c31@user/qrpnxz) (Disconnected: Replaced by new connection)
11:45:18 qrpnxz joins (abc4f95c31@user/qrpnxz)
11:45:35 × deadmarshal quits (~deadmarsh@95.38.231.102) (Ping timeout: 252 seconds)
11:45:47 qrpnxz parts (abc4f95c31@user/qrpnxz) (Disconnected: closed)
11:45:53 qrpnxz joins (abc4f95c31@user/qrpnxz)
11:48:21 vpan joins (~0@212.117.1.172)
11:53:40 × epolanski quits (uid312403@id-312403.helmsley.irccloud.com) (Quit: Connection closed for inactivity)
11:53:57 SummerSonw joins (~The_viole@203.77.49.232)
11:54:25 × Erutuon quits (~Erutuon@user/erutuon) (Ping timeout: 256 seconds)
11:55:00 merijn joins (~merijn@83-160-49-249.ip.xs4all.nl)
11:56:30 × Vajb quits (~Vajb@hag-jnsbng11-58c3a8-176.dhcp.inet.fi) (Read error: Connection reset by peer)
11:57:03 CiaoSen joins (~Jura@p200300c957347b002a3a4dfffe84dbd5.dip0.t-ipconnect.de)
11:58:16 × coot quits (~coot@89-64-85-93.dynamic.chello.pl) (Remote host closed the connection)
12:00:12 deadmarshal joins (~deadmarsh@95.38.231.102)
12:00:31 qrpnxz parts (abc4f95c31@user/qrpnxz) (Disconnected: Replaced by new connection)
12:00:32 qrpnxz joins (abc4f95c31@user/qrpnxz)
12:01:01 qrpnxz parts (abc4f95c31@user/qrpnxz) (Disconnected: closed)
12:01:01 × burnsidesLlama quits (~burnsides@dhcp168-011.wadham.ox.ac.uk) (Remote host closed the connection)
12:01:03 × bitdex quits (~bitdex@gateway/tor-sasl/bitdex) (Remote host closed the connection)
12:01:25 qrpnxz joins (abc4f95c31@user/qrpnxz)
12:01:53 bitdex joins (~bitdex@gateway/tor-sasl/bitdex)
12:07:42 coot joins (~coot@2a02:a310:e03f:8500:5cc8:47c:8ec0:b827)
12:24:58 Vajb joins (~Vajb@hag-jnsbng11-58c3a8-176.dhcp.inet.fi)
12:29:33 × merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 256 seconds)
12:30:43 × coot quits (~coot@2a02:a310:e03f:8500:5cc8:47c:8ec0:b827) (Remote host closed the connection)
12:31:46 wroathe joins (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net)
12:31:46 × wroathe quits (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Changing host)
12:31:46 wroathe joins (~wroathe@user/wroathe)
12:32:05 coot joins (~coot@2a02:a310:e03f:8500:5cc8:47c:8ec0:b827)
12:34:20 × coot quits (~coot@2a02:a310:e03f:8500:5cc8:47c:8ec0:b827) (Remote host closed the connection)
12:34:39 × jlamothe quits (~jlamothe@198.251.61.229) (Ping timeout: 256 seconds)
12:35:30 coot joins (~coot@2a02:a310:e03f:8500:5cc8:47c:8ec0:b827)
12:36:43 × wroathe quits (~wroathe@user/wroathe) (Ping timeout: 268 seconds)
12:38:21 × bitmapper quits (uid464869@id-464869.lymington.irccloud.com) (Quit: Connection closed for inactivity)
12:40:32 × coot quits (~coot@2a02:a310:e03f:8500:5cc8:47c:8ec0:b827) (Remote host closed the connection)
12:41:49 coot joins (~coot@2a02:a310:e03f:8500:5cc8:47c:8ec0:b827)
12:48:35 × coot quits (~coot@2a02:a310:e03f:8500:5cc8:47c:8ec0:b827) (Remote host closed the connection)
12:49:20 jeetelongname joins (~jeet@88-111-159-26.dynamic.dsl.as9105.com)
12:49:23 × deadmarshal quits (~deadmarsh@95.38.231.102) (Ping timeout: 256 seconds)
12:49:38 loki_ joins (~loki@149.red-88-20-26.staticip.rima-tde.net)
12:49:56 toastloop joins (toastloop@user/toastloop)
12:50:00 coot joins (~coot@2a02:a310:e03f:8500:5cc8:47c:8ec0:b827)
12:50:00 yauhsien_ joins (~yauhsien@118-167-43-174.dynamic-ip.hinet.net)
12:50:17 × yauhsien quits (~yauhsien@118-167-43-174.dynamic-ip.hinet.net) (Ping timeout: 268 seconds)
12:52:24 <loki_> So I was wondering why
12:52:26 <loki_> lucky :: (Integral a) => a -> String
12:52:26 <loki_> lucky 7 = "LUCKY NUMBER SEVEN!"
12:52:28 <loki_> lucky x = "Sorry, you're out of luck, pal!"
12:52:29 <loki_> Works
12:52:34 <loki_> but lucky :: (Num a) => a -> String lucky 7 = "LUCKY NUMBER SEVEN!" lucky x = "Sorry, you're out of luck, pal!"
12:52:39 <loki_> Doesn't
12:52:52 lavaman joins (~lavaman@98.38.249.169)
12:53:09 <loki_> The second example should be:
12:53:13 <loki_> lucky :: (Num a) => a -> String
12:53:21 <loki_> lucky 7 = "lucky 7!"
12:53:23 <loki_> lucky x = "Sorry, you're out of luck, pal!"
12:53:47 × jeetelongname quits (~jeet@88-111-159-26.dynamic.dsl.as9105.com) (Ping timeout: 252 seconds)
12:53:53 <hpc> (or use semicolons if you really absolutely must for whatever reason have it all on one line)
12:54:21 <hpc> ((if you're putting this in ghci, try :{ and :} around your multiline definition as well))
12:54:35 <hpc> (((or just use a file :P)))
12:54:39 <loki_> (thanks)
12:54:43 <loki_> ((also thanks))
12:54:46 <hpc> :D
12:54:49 <geekosaur> pattern matching on numbers secretly uses an Eq instance; this may be present for Integral, but it's absent for Num these days
12:54:52 <loki_> (((also, I was using a file)))
12:55:05 × coot quits (~coot@2a02:a310:e03f:8500:5cc8:47c:8ec0:b827) (Remote host closed the connection)
12:55:15 <hpc> ah, that's probably what it is then
12:55:42 raehik joins (~raehik@cpc95906-rdng25-2-0-cust156.15-3.cable.virginm.net)
12:55:48 <geekosaur> I'd want to see the error message, since "doesn't work" doesn't tell me much
12:56:18 coot joins (~coot@2a02:a310:e03f:8500:5cc8:47c:8ec0:b827)
12:56:57 × lavaman quits (~lavaman@98.38.249.169) (Ping timeout: 240 seconds)
12:57:12 <loki_> It's:
12:57:16 <loki_> Could not deduce (Eq a) arising from the literal ‘7’
12:57:16 <geekosaur> %% :info Integral
12:57:18 <yahb> geekosaur: http://qp.mniip.com/y/36
12:57:21 <geekosaur> yep
12:57:25 × Benzi-Junior quits (~BenziJuni@88-149-66-61.du.xdsl.is) (Ping timeout: 240 seconds)
12:57:27 <loki_> from the context: Num a
12:57:53 <loki_> But it feels like it should be able to deduce Eq from Num, no?
12:58:02 <geekosaur> Not for several years
12:58:26 <loki_> Do you know why?
12:58:28 <geekosaur> I don't recall why Eq and Show were removed from Num at this point
12:58:30 × coot quits (~coot@2a02:a310:e03f:8500:5cc8:47c:8ec0:b827) (Client Quit)
12:58:34 <geekosaur> Haskell 98 required them
12:59:56 deadmarshal joins (~deadmarsh@95.38.231.102)
13:02:20 loki_ parts (~loki@149.red-88-20-26.staticip.rima-tde.net) ()
13:02:35 wroathe joins (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net)
13:02:35 × wroathe quits (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Changing host)
13:02:35 wroathe joins (~wroathe@user/wroathe)
13:04:42 loki_ joins (~loki@149.red-88-20-26.staticip.rima-tde.net)
13:06:13 × max22- quits (~maxime@2a01cb088335980010d18673f284ce01.ipv6.abo.wanadoo.fr) (Ping timeout: 240 seconds)
13:07:31 × wroathe quits (~wroathe@user/wroathe) (Ping timeout: 256 seconds)
13:10:21 jakalx parts (~jakalx@base.jakalx.net) ()
13:11:11 jakalx joins (~jakalx@base.jakalx.net)
13:11:21 × hololeap quits (~hololeap@user/hololeap) (Remote host closed the connection)
13:12:15 × yauhsien_ quits (~yauhsien@118-167-43-174.dynamic-ip.hinet.net) (Remote host closed the connection)
13:12:40 hololeap joins (~hololeap@user/hololeap)
13:13:00 yauhsien joins (~yauhsien@118-167-43-174.dynamic-ip.hinet.net)
13:14:23 pretty_dumm_guy joins (trottel@gateway/vpn/protonvpn/prettydummguy/x-88029655)
13:14:37 × Akiva quits (~Akiva@user/Akiva) (Ping timeout: 240 seconds)
13:18:50 × loki_ quits (~loki@149.red-88-20-26.staticip.rima-tde.net) (Quit: leaving)
13:18:52 × Vajb quits (~Vajb@hag-jnsbng11-58c3a8-176.dhcp.inet.fi) (Read error: Connection reset by peer)
13:19:33 loki_ joins (~loki@149.red-88-20-26.staticip.rima-tde.net)
13:21:05 Vajb joins (~Vajb@hag-jnsbng11-58c3a8-176.dhcp.inet.fi)
13:26:09 × aliosablack quits (~chomwitt@ppp-2-85-245-134.home.otenet.gr) (Quit: Leaving)
13:26:28 aliosablack joins (~chomwitt@2a02:587:dc1c:a00:12c3:7bff:fe6d:d374)
13:27:23 × yauhsien quits (~yauhsien@118-167-43-174.dynamic-ip.hinet.net) (Remote host closed the connection)
13:27:26 slowButPresent joins (~slowButPr@user/slowbutpresent)
13:27:35 × Vajb quits (~Vajb@hag-jnsbng11-58c3a8-176.dhcp.inet.fi) (Read error: Connection reset by peer)
13:27:46 Vajb joins (~Vajb@hag-jnsbng11-58c3a8-176.dhcp.inet.fi)
13:28:10 yauhsien joins (~yauhsien@118-167-43-174.dynamic-ip.hinet.net)
13:29:39 timCF joins (~timCF@m91-129-100-224.cust.tele2.ee)
13:30:03 × Vajb quits (~Vajb@hag-jnsbng11-58c3a8-176.dhcp.inet.fi) (Read error: Connection reset by peer)
13:30:28 Vajb joins (~Vajb@2001:999:62:e042:be01:afcc:85c5:1e46)
13:33:19 wroathe joins (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net)
13:33:19 × wroathe quits (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Changing host)
13:33:19 wroathe joins (~wroathe@user/wroathe)
13:34:55 fef joins (~thedawn@user/thedawn)
13:38:02 × wroathe quits (~wroathe@user/wroathe) (Ping timeout: 240 seconds)
13:38:27 × toastloop quits (toastloop@user/toastloop) (Quit: Leaving)
13:40:15 ProfSimm joins (~ProfSimm@87.227.196.109)
13:40:57 × deadmarshal quits (~deadmarsh@95.38.231.102) (Ping timeout: 256 seconds)
13:47:49 deadmarshal joins (~deadmarsh@95.38.231.102)
13:49:18 × tromp quits (~textual@dhcp-077-249-230-040.chello.nl) (Quit: My iMac has gone to sleep. ZZZzzz…)
13:55:02 Benzi-Junior joins (~BenziJuni@dsl-149-66-61.hive.is)
13:56:42 × timCF quits (~timCF@m91-129-100-224.cust.tele2.ee) (Quit: leaving)
13:58:24 <int-e> dminuoso: or you could go crazy and emulate treeowl: https://gist.github.com/int-e/d8caa46bcc784df86f9997abc5cafff1
14:03:08 tromp joins (~textual@dhcp-077-249-230-040.chello.nl)
14:04:22 × FinnElija quits (~finn_elij@user/finn-elija/x-0085643) (Killed (NickServ (Forcing logout FinnElija -> finn_elija)))
14:04:23 FinnElija joins (~finn_elij@user/finn-elija/x-0085643)
14:06:27 × falafel_ quits (~falafel@cpe-76-168-195-162.socal.res.rr.com) (Ping timeout: 256 seconds)
14:07:37 <int-e> (oops, that didn't compile; now it does)
14:10:10 merijn joins (~merijn@83-160-49-249.ip.xs4all.nl)
14:12:00 eron joins (~eron@186.192.87.8)
14:15:09 wroathe joins (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net)
14:15:09 × wroathe quits (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Changing host)
14:15:09 wroathe joins (~wroathe@user/wroathe)
14:20:26 × wroathe quits (~wroathe@user/wroathe) (Ping timeout: 260 seconds)
14:20:37 × merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 240 seconds)
14:22:19 × mncheck quits (~mncheck@193.224.205.254) (Ping timeout: 256 seconds)
14:22:26 × acidjnk quits (~acidjnk@p200300d0c7271e77d154eb1f1200bcdb.dip0.t-ipconnect.de) (Ping timeout: 245 seconds)
14:23:05 max22- joins (~maxime@2a01cb0883359800ba08fcf16942d473.ipv6.abo.wanadoo.fr)
14:31:31 jlamothe joins (~jlamothe@198.251.61.229)
14:33:09 × briandaed quits (~root@185.234.208.208.r.toneticgroup.pl) (Quit: Lost terminal)
14:33:28 mncheck joins (~mncheck@193.224.205.254)
14:33:30 × machinedgod quits (~machinedg@24.105.81.50) (Ping timeout: 260 seconds)
14:39:17 × justsomeguy quits (~justsomeg@user/justsomeguy) (Ping timeout: 240 seconds)
14:47:37 × chomwitt quits (~chomwitt@ppp-2-85-245-134.home.otenet.gr) (Ping timeout: 240 seconds)
14:47:57 × aliosablack quits (~chomwitt@2a02:587:dc1c:a00:12c3:7bff:fe6d:d374) (Ping timeout: 240 seconds)
14:54:15 × benin quits (~benin@183.82.27.57) (Ping timeout: 268 seconds)
14:56:47 merijn joins (~merijn@83-160-49-249.ip.xs4all.nl)
14:57:58 <hololeap> how often do people use type names as quasi-documentation, for instance type Steps = Int ? the significant problem with it seems to be a newcomer won't know what Steps actually is without looking for the definition
14:58:08 Sgeo joins (~Sgeo@user/sgeo)
14:59:00 <hololeap> I'm tempted to define it as `newtype Steps a = Steps a` so that I can have `Steps Int` and that solves both problems
15:00:15 <geekosaur> the significant probloem some would claim for it is it looks like a distinct type, but isn't, thus giving a falkse sense of type safety
15:01:02 × merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 240 seconds)
15:01:50 dextaa5 is now known as dextaa
15:02:07 <hololeap> yeah, I guess you can't substitute real documentation
15:02:16 × notzmv quits (~zmv@user/notzmv) (Ping timeout: 268 seconds)
15:02:18 eggplantade joins (~Eggplanta@2600:1700:bef1:5e10:319d:53ed:6690:e5b4)
15:02:42 benin joins (~benin@183.82.27.57)
15:04:49 × SummerSonw quits (~The_viole@203.77.49.232) (Ping timeout: 256 seconds)
15:04:55 × shapr quits (~user@pool-100-36-247-68.washdc.fios.verizon.net) (Read error: Connection reset by peer)
15:05:41 shapr joins (~user@pool-100-36-247-68.washdc.fios.verizon.net)
15:06:37 × eggplantade quits (~Eggplanta@2600:1700:bef1:5e10:319d:53ed:6690:e5b4) (Ping timeout: 240 seconds)
15:07:54 justsomeguy joins (~justsomeg@user/justsomeguy)
15:07:56 × yauhsien quits (~yauhsien@118-167-43-174.dynamic-ip.hinet.net) (Remote host closed the connection)
15:08:43 yauhsien joins (~yauhsien@118-167-43-174.dynamic-ip.hinet.net)
15:12:50 coot joins (~coot@89-64-85-93.dynamic.chello.pl)
15:13:25 × yauhsien quits (~yauhsien@118-167-43-174.dynamic-ip.hinet.net) (Ping timeout: 240 seconds)
15:14:32 × vpan quits (~0@212.117.1.172) (Quit: Leaving.)
15:18:51 yauhsien joins (~yauhsien@118-167-43-174.dynamic-ip.hinet.net)
15:21:47 wroathe joins (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net)
15:21:47 × wroathe quits (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Changing host)
15:21:47 wroathe joins (~wroathe@user/wroathe)
15:22:00 × zangi quits (~zangi@103.154.230.133) (Quit: zangi)
15:22:33 × coot quits (~coot@89-64-85-93.dynamic.chello.pl) (Remote host closed the connection)
15:23:01 × zaquest quits (~notzaques@5.130.79.72) (Remote host closed the connection)
15:23:26 bu5hyt0p_ joins (~rmsare@2601:281:c780:a510:31c5:bd6a:19eb:499b)
15:24:01 coot joins (~coot@2a02:a310:e03f:8500:5cc8:47c:8ec0:b827)
15:24:07 zaquest joins (~notzaques@5.130.79.72)
15:26:53 × jgeerds quits (~jgeerds@55d4ac73.access.ecotel.net) (Ping timeout: 250 seconds)
15:32:06 [itchyjunk] joins (~itchyjunk@user/itchyjunk/x-7353470)
15:32:16 × coot quits (~coot@2a02:a310:e03f:8500:5cc8:47c:8ec0:b827) (Remote host closed the connection)
15:37:53 coot joins (~coot@2a02:a310:e03f:8500:5cc8:47c:8ec0:b827)
15:38:29 n3rdy1 joins (~n3rdy1@2601:281:c780:a510:31c5:bd6a:19eb:499b)
15:38:44 × justsomeguy quits (~justsomeg@user/justsomeguy) (Quit: WeeChat 3.3)
15:38:55 merijn joins (~merijn@83-160-49-249.ip.xs4all.nl)
15:39:52 bu5hyt0p_ parts (~rmsare@2601:281:c780:a510:31c5:bd6a:19eb:499b) ()
15:43:11 chomwitt joins (~chomwitt@ppp-2-85-245-134.home.otenet.gr)
15:43:12 aliosablack joins (~chomwitt@ppp-2-85-245-134.home.otenet.gr)
15:45:46 lavaman joins (~lavaman@98.38.249.169)
15:46:20 × loki_ quits (~loki@149.red-88-20-26.staticip.rima-tde.net) (Quit: leaving)
15:47:55 dschrempf joins (~dominik@070-207.dynamic.dsl.fonira.net)
15:49:22 × FinnElija quits (~finn_elij@user/finn-elija/x-0085643) (Remote host closed the connection)
15:50:14 × coot quits (~coot@2a02:a310:e03f:8500:5cc8:47c:8ec0:b827) (Quit: coot)
15:51:28 coot joins (~coot@2a02:a310:e03f:8500:5cc8:47c:8ec0:b827)
15:52:19 FinnElija joins (~finn_elij@user/finn-elija/x-0085643)
15:54:45 arjun joins (~arjun@user/arjun)
15:55:37 × dsrt^ quits (~dsrt@64.253.22.77) (Ping timeout: 240 seconds)
15:56:39 dsrt^ joins (~dsrt@64.253.22.77)
15:56:44 <Inst> :t join
15:56:45 <lambdabot> Monad m => m (m a) -> m a
15:57:24 × mncheck quits (~mncheck@193.224.205.254) (Quit: Leaving)
15:58:13 <Inst> :t return
15:58:14 <lambdabot> Monad m => a -> m a
16:00:03 chozorho joins (~chozorho@2601:146:300:c30::9401)
16:00:42 <[exa]> o ye great truths of the universe
16:03:18 × dschrempf quits (~dominik@070-207.dynamic.dsl.fonira.net) (Ping timeout: 268 seconds)
16:03:52 × arjun quits (~arjun@user/arjun) (Remote host closed the connection)
16:05:06 × tromp quits (~textual@dhcp-077-249-230-040.chello.nl) (Quit: My iMac has gone to sleep. ZZZzzz…)
16:05:38 machinedgod joins (~machinedg@24.105.81.50)
16:07:15 tromp joins (~textual@dhcp-077-249-230-040.chello.nl)
16:07:56 × merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 252 seconds)
16:10:06 × Feuermagier quits (~Feuermagi@user/feuermagier) (Ping timeout: 268 seconds)
16:11:26 zmt00 joins (~zmt00@user/zmt00)
16:14:02 mncheck joins (~mncheck@193.224.205.254)
16:17:14 jgeerds joins (~jgeerds@55d4ac73.access.ecotel.net)
16:18:37 × Inst quits (~delicacie@2601:6c4:4080:3f80:d9cb:b805:baaa:394f) (Ping timeout: 240 seconds)
16:18:45 jgeerds_ joins (~jgeerds@55d4ac73.access.ecotel.net)
16:21:46 × jgeerds quits (~jgeerds@55d4ac73.access.ecotel.net) (Ping timeout: 260 seconds)
16:24:14 × yauhsien quits (~yauhsien@118-167-43-174.dynamic-ip.hinet.net) (Remote host closed the connection)
16:24:54 yauhsien joins (~yauhsien@118-167-43-174.dynamic-ip.hinet.net)
16:25:47 <ProfSimm> In Haskell, can I create a type which has custom (polymorphic) implementations of core functions, so those functions can work with my custom type?
16:28:16 jollygood2 joins (~bc8147f2@cerf.good1.com)
16:28:17 × xff0x quits (~xff0x@2001:1a81:52d0:e400:55eb:e48f:480a:9ef0) (Ping timeout: 252 seconds)
16:29:24 xff0x joins (~xff0x@2001:1a81:52d0:e400:f16b:c82a:3197:1eaa)
16:31:28 <[exa]> ProfSimm: depends on which core functions. Usually not in general, e.g. it's hard to overload `length`.
16:31:54 × Bartol quits (~Bartol@user/Bartol) (Quit: Lost terminal)
16:32:09 <zero> what?
16:32:22 <monochrom> But length is now a method of Foldable, overloadable. :)
16:32:26 <zero> @type length
16:32:27 <lambdabot> Foldable t => t a -> Int
16:32:30 <zero> yeah
16:32:40 <monochrom> You may have to pick another example, like fst.
16:32:55 <zero> just make your type an instance of Foldable and overload length as you wish
16:33:09 <monochrom> But let's take a step back. I don't think we even know what the question means.
16:33:28 <geekosaur> that was my problem. I'm not even sure how to ask for a clarification
16:33:59 <monochrom> "Show an example?" always works, but I didn't bother.
16:36:08 <zero> what are "core" functions?
16:36:08 × Vajb quits (~Vajb@2001:999:62:e042:be01:afcc:85c5:1e46) (Read error: Connection reset by peer)
16:36:20 Vajb joins (~Vajb@hag-jnsbng11-58c3a8-176.dhcp.inet.fi)
16:36:53 <geekosaur> in any case, if the function is part of a typeclass then you'd instance the typeclass for your type
16:37:16 <geekosaur> if it's not, there's not much you can do
16:37:36 <geekosaur> but as zero notes, we may have different notions of "core function"
16:37:57 × joo-_ quits (~joo-_@fsf/member/joo--) (Ping timeout: 240 seconds)
16:39:12 × Vajb quits (~Vajb@hag-jnsbng11-58c3a8-176.dhcp.inet.fi) (Read error: Connection reset by peer)
16:39:15 <ProfSimm> Well let's say I want "length" to work with a type I made where length is calculated in some bizarre way.
16:39:22 <ProfSimm> I make a typeclass?
16:39:40 <geekosaur> :t length
16:39:40 <zero> you make an instance
16:39:41 <lambdabot> Foldable t => t a -> Int
16:39:49 <geekosaur> so you make an instance of Foldable
16:39:52 <monochrom> Check out the Foldable type class in the standard library. It already exists.
16:39:57 joo-_ joins (~joo-_@87-49-147-205-mobile.dk.customer.tdc.net)
16:39:57 × joo-_ quits (~joo-_@87-49-147-205-mobile.dk.customer.tdc.net) (Changing host)
16:39:57 joo-_ joins (~joo-_@fsf/member/joo--)
16:40:04 <zero> instance Foldable Yourtype where length = ...
16:40:34 <ProfSimm> Oh yes, typeclass is interfaces and types are classes, I'm thinking in OOP terms
16:40:36 <monochrom> But I am sure the real problem does not involve length.
16:40:55 <monochrom> s/problem/question/
16:41:06 <zero> ProfSimm: not *really* interfaces, but close enough
16:41:06 <ProfSimm> monochrom: the real problem was more a general mechanism of how this is best done so I think it kinda answers my question
16:41:25 <ProfSimm> zero: what would be the main differences you'd say?
16:42:05 Bartol joins (~Bartol@user/Bartol)
16:42:06 × Bartol quits (~Bartol@user/Bartol) (Client Quit)
16:42:20 Bartol joins (~Bartol@user/Bartol)
16:42:27 burnsidesLlama joins (~burnsides@dhcp168-011.wadham.ox.ac.uk)
16:42:46 × yauhsien quits (~yauhsien@118-167-43-174.dynamic-ip.hinet.net) (Remote host closed the connection)
16:43:25 <geekosaur> most OOP systems would let you override e.g. length even for an individual object, as long as you conformed to the interface. in Haskelll the "interface" belongs to the type, and in the background it's passing around a record of implementation functions
16:43:31 yauhsien joins (~yauhsien@118-167-43-174.dynamic-ip.hinet.net)
16:44:01 <ProfSimm> geekosaur: oh I think many OOP languages you'd find also restrict interface implementation to the whole type
16:44:16 <monochrom> In Java, an interface is a type. In Haskell, a class is not a type.
16:44:32 <monochrom> There are more.
16:44:54 <ProfSimm> monochrom: I didn't get that sorry
16:45:06 <ProfSimm> In Java, both interfaces and classes are types
16:45:27 <ProfSimm> But interfaces are abstract which I suppose would be like typeclasses no
16:45:36 <geekosaur> you cannot, for example, use Foldable as a type in Haskell
16:45:41 <geekosaur> you use them as constraints
16:45:46 <geekosaur> :t length
16:45:47 <lambdabot> Foldable t => t a -> Int
16:45:51 × wroathe quits (~wroathe@user/wroathe) (Ping timeout: 268 seconds)
16:46:00 <monochrom> The similarity comes from the fact that they solve the same problem.
16:46:27 <monochrom> The difference means that they solve the problem from different approaches.
16:46:46 × yauhsien quits (~yauhsien@118-167-43-174.dynamic-ip.hinet.net) (Remote host closed the connection)
16:46:47 wroathe joins (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net)
16:46:47 × wroathe quits (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Changing host)
16:46:47 wroathe joins (~wroathe@user/wroathe)
16:46:55 <geekosaur> in Java you'd write the equivalent of `Foldable a -> Int`, but you can't use a typeclass that way in Haskell
16:48:03 slowtype- joins (~slowtyper@79.103.178.210.dsl.dyn.forthnet.gr)
16:48:05 × slowtyper quits (~slowtyper@user/slowtyper) (Ping timeout: 252 seconds)
16:48:15 <zero> in haskell you can constrain the same polymorphic type variable by multiple classes
16:48:37 <zero> hum
16:48:47 <zero> not sure i phrased that correctly
16:48:50 <monochrom> I have a problem, I want to do something fun. I have two friends proposing two solutions, one is to play AOE4, the other is to learn more math.
16:48:57 × lavaman quits (~lavaman@98.38.249.169) (Ping timeout: 240 seconds)
16:49:11 <monochrom> Now suddenly playing AOE4 and learning more math are "the same" just because they solve the same problem.
16:49:25 <monochrom> Or even remotely related.
16:49:30 <int-e> fun.
16:49:59 <ProfSimm> Well I'm not saying they're the same, I'm trying to learn how they're not the same
16:50:13 <zero> (Math a, AOE4 a) => Monochrom -> a -> Fun
16:50:43 <monochrom> At any rate, I now study the Giry monad and going deep into abstract measure theory during the day, and grind AOE4 during the night.
16:51:11 × mbuf quits (~Shakthi@223.178.76.172) (Quit: Leaving)
16:51:21 <monochrom> Did you know that you can have a probability distribution over probability distributions? >:)
16:51:31 <geekosaur> zero, I think it's closer to both AOE and Math instance MonochromFun
16:51:44 <zero> geekosaur: i agree
16:52:12 <int-e> monochrom: Ah. That's why this name sounded familiar...
16:52:26 × analognoise quits (~analognoi@23.105.41.153) (Read error: Connection reset by peer)
16:52:41 <int-e> monochrom: from here: https://isabelle.in.tum.de/library/HOL/HOL-Probability/Giry_Monad.html
16:53:00 <monochrom> w00t HOL
16:53:07 <int-e> Isabelle/HOL
16:53:17 <int-e> (not to be confused with HOL4)
16:53:32 <monochrom> Haskell classes are really much closer to C++ overloading than any Java/Scala "interface" notion.
16:53:54 yauhsien joins (~yauhsien@118-167-43-174.dynamic-ip.hinet.net)
16:54:18 <monochrom> Classes are groupings of overloadable operators. This "overloadable" is in the C++ sense.
16:54:24 <zero> it's just that Haskell's overloading is organised
16:54:37 jeetelongname joins (~jeet@88-111-159-26.dynamic.dsl.as9105.com)
16:54:41 <monochrom> Indeed C++ concepts are a generalization of Haskell classes.
16:55:01 <monochrom> Yeah I say "organized overloading".
16:55:08 <int-e> https://swizec.com/blog/week-20-making-adhoc-polymorphism-less-ad-hoc
16:55:10 Vajb joins (~Vajb@hag-jnsbng11-58c3a8-176.dhcp.inet.fi)
16:55:45 × alfonsox quits (~quassel@103.92.42.192) (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.)
16:56:18 <zero> i wonder... what if class constraints were mandatory for every type variable?
16:56:57 <int-e> then we wouldn't be here
16:57:30 <monochrom> Then you would need a class that has no methods so you can translate "id :: a -> a" to "id :: Type a => a -> a"
16:57:33 <geekosaur> zero: what constraint would you give to a in the type of length?
16:58:35 <monochrom> > let i :: () => a -> a; i x = x in i "Phone"
16:58:36 <lambdabot> "Phone"
16:58:48 × yauhsien quits (~yauhsien@118-167-43-174.dynamic-ip.hinet.net) (Ping timeout: 268 seconds)
16:58:48 <monochrom> There is your mandatory constraint. >:)
16:59:23 <monochrom> > let j :: () => Int; j = 4 in j
16:59:24 <lambdabot> 4
16:59:30 × FinnElija quits (~finn_elij@user/finn-elija/x-0085643) (Killed (NickServ (Forcing logout FinnElija -> finn_elija)))
16:59:30 finn_elija joins (~finn_elij@user/finn-elija/x-0085643)
16:59:30 finn_elija is now known as FinnElija
16:59:40 <monochrom> You can even mandate constraints for type constants, too >:)
16:59:46 <zero> geekosaur: Lenghtable :p
16:59:55 <zero> i get the point
17:00:10 <geekosaur> but lengthable applies to the Foldable, not the element type
17:00:26 <zero> ah i see
17:01:22 <zero> nevermind then
17:01:41 <geekosaur> in fact the lack of constraint on `a` there tells you something important: `length` cannot inspect `a`s
17:01:42 <monochrom> Tautologies and vacuity solve a lot of problems. :)
17:02:20 <zero> what if we allowed functions with no constraints to be arbitrarily overloaded then?
17:02:45 <int-e> how is the compiler supposed to know which one you want?
17:02:50 <geekosaur> then we'd have the kind of zoo C++ has, where >> can be both a bitshoift and an input operation
17:02:56 <zero> by the type
17:03:12 <int-e> but we like types to be inferred
17:03:54 eggplantade joins (~Eggplanta@2600:1700:bef1:5e10:319d:53ed:6690:e5b4)
17:04:06 <zero> yes, so unconstrained functions would be inferred
17:04:57 × raehik quits (~raehik@cpc95906-rdng25-2-0-cust156.15-3.cable.virginm.net) (Ping timeout: 256 seconds)
17:04:57 <zero> well i'm not thinking very deeply about this
17:05:11 <monochrom> Just look at C++. It already does that.
17:05:25 <monochrom> It is very doable.
17:05:39 <monochrom> The issue though is error messages.
17:05:52 <int-e> zero: To me, you have a vague idea of a solution that is looking for a problem.
17:06:00 <zero> int-e: yes
17:06:07 <int-e> It's hard to take it seriously.
17:06:19 <zero> i'm just spitballing
17:06:26 <monochrom> Joke on book reviews: "This book fills a much needed gap."
17:06:44 <zero> :)
17:07:57 × eggplantade quits (~Eggplanta@2600:1700:bef1:5e10:319d:53ed:6690:e5b4) (Ping timeout: 240 seconds)
17:08:39 × tromp quits (~textual@dhcp-077-249-230-040.chello.nl) (Quit: My iMac has gone to sleep. ZZZzzz…)
17:09:39 <zero> ok, so making unconstrained functions overloadable (but having to respect the more general polymorphic type signature) would be equivalent to...
17:10:36 <zero> having one class per... wait
17:12:01 notzmv joins (~zmv@user/notzmv)
17:13:01 × jgeerds_ quits (~jgeerds@55d4ac73.access.ecotel.net) (Ping timeout: 240 seconds)
17:16:13 <zero> hypothesizing is important, even if it leads nowhere
17:16:43 <geekosaur> if you learn something from it, it is
17:17:15 <zero> fun is a better goal than knowledge
17:18:18 <ProfSimm> In OOP languages I type foo. and I see a list of methods I can apply to foo. What's the alternative in Haskell given I type the function first?
17:18:25 merijn joins (~merijn@83-160-49-249.ip.xs4all.nl)
17:19:05 <zero> hoogle
17:19:28 tromp joins (~textual@dhcp-077-249-230-040.chello.nl)
17:19:59 <zero> https://hoogle.haskell.org
17:20:09 lbseale joins (~ep1ctetus@user/ep1ctetus)
17:20:10 <shapr> also haskell-language-server with type holes
17:20:54 <zero> ProfSimm: oh wait, is foo a type?
17:21:05 <ProfSimm> Hmm is there no some immediate feedback
17:21:22 <shapr> you can get 'intellisense' completion with haskell-language-server
17:21:27 <geekosaur> hls gives you immediate feedback
17:21:43 <ProfSimm> I mean, how would it work when i type the function first before the argument
17:21:56 <shapr> but you'll likely want to use type holes to break it down
17:22:18 <shapr> you could also use wingman to do case splits and etc
17:23:01 <zero> you can also type `:info Int` into ghci for example to list all it's classes
17:23:04 <shapr> ProfSimm: check out the demos? https://haskell-language-server.readthedocs.io/en/latest/features.html#demos
17:26:11 <zero> ProfSimm: you might be thinking backwards. if you are typing a function, you must know what type the argument is, right? because if you ask for a list of possible types, that list is ptentially infinite. the relevant thing t know in that situation would be the type of the function you just typed
17:26:47 <zero> what would you expect to get when typing `id` ?
17:37:49 × wroathe quits (~wroathe@user/wroathe) (Ping timeout: 256 seconds)
17:38:29 × kuribas quits (~user@ptr-25vy0i8krrkad5xv3l1.18120a2.ip6.access.telenet.be) (Quit: ERC (IRC client for Emacs 26.3))
17:41:29 niemand joins (~niemand@p5796adc9.dip0.t-ipconnect.de)
17:41:38 niemand parts (~niemand@p5796adc9.dip0.t-ipconnect.de) ()
17:43:28 Akiva joins (~Akiva@user/Akiva)
17:47:12 econo joins (uid147250@user/econo)
17:49:31 × yin quits (~yin@user/zero) (Remote host closed the connection)
17:50:42 × coot quits (~coot@2a02:a310:e03f:8500:5cc8:47c:8ec0:b827) (Remote host closed the connection)
17:52:00 eggplantade joins (~Eggplanta@2600:1700:bef1:5e10:319d:53ed:6690:e5b4)
17:54:52 wroathe joins (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net)
17:54:52 × wroathe quits (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Changing host)
17:54:52 wroathe joins (~wroathe@user/wroathe)
17:58:11 <monochrom> This is why we say we're doing "functional programming".
17:58:26 <monochrom> And why the other guys say they're doing "object programming".
17:59:55 × wroathe quits (~wroathe@user/wroathe) (Ping timeout: 256 seconds)
18:02:39 × tromp quits (~textual@dhcp-077-249-230-040.chello.nl) (Quit: My iMac has gone to sleep. ZZZzzz…)
18:05:39 tromp joins (~textual@dhcp-077-249-230-040.chello.nl)
18:06:36 × coolnickname quits (uid531864@user/coolnickname) (Quit: Connection closed for inactivity)
18:08:31 wroathe joins (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net)
18:08:31 × wroathe quits (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Changing host)
18:08:31 wroathe joins (~wroathe@user/wroathe)
18:09:08 <EvanR> when I type a function, I want an immediate list of possible arguments to apply it to xD
18:09:34 <EvanR> but seriously there's been much said about "power of the dot" OOP tooling
18:09:47 tzh joins (~tzh@c-24-21-73-154.hsd1.wa.comcast.net)
18:10:29 × geekosaur quits (~geekosaur@xmonad/geekosaur) (Remote host closed the connection)
18:11:52 <EvanR> the haskell equivalent would be ModuleName.<showMeTheThings> or upcoming myRecord.<showMeTheFields>
18:13:00 geekosaur joins (~geekosaur@xmonad/geekosaur)
18:15:17 × deadmarshal quits (~deadmarsh@95.38.231.102) (Ping timeout: 240 seconds)
18:16:36 Everything joins (~Everythin@37.115.210.35)
18:20:12 × wroathe quits (~wroathe@user/wroathe) (Ping timeout: 268 seconds)
18:20:59 wroathe joins (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net)
18:20:59 × wroathe quits (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Changing host)
18:20:59 wroathe joins (~wroathe@user/wroathe)
18:21:31 × phma quits (phma@2001:5b0:211c:9c18:ac13:6342:6a86:65e4) (Read error: Connection reset by peer)
18:21:43 raehik joins (~raehik@cpc95906-rdng25-2-0-cust156.15-3.cable.virginm.net)
18:22:35 phma joins (phma@2001:5b0:211b:ad08:e5d3:c318:2701:f71f)
18:22:43 coolnickname joins (uid531864@user/coolnickname)
18:22:48 justsomeguy joins (~justsomeg@user/justsomeguy)
18:26:09 × tromp quits (~textual@dhcp-077-249-230-040.chello.nl) (Quit: My iMac has gone to sleep. ZZZzzz…)
18:26:22 × merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 260 seconds)
18:27:56 × eggplantade quits (~Eggplanta@2600:1700:bef1:5e10:319d:53ed:6690:e5b4) (Remote host closed the connection)
18:28:58 tromp joins (~textual@dhcp-077-249-230-040.chello.nl)
18:31:03 eggplantade joins (~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net)
18:33:25 goepsilongo joins (~goepsilon@2806:263:c404:8000:f42f:2a6e:3c81:2519)
18:33:43 Midjak joins (~Midjak@may53-1-78-226-116-92.fbx.proxad.net)
18:36:42 × Jing quits (~hedgehog@115.207.51.59) (Read error: Connection reset by peer)
18:37:30 Jing joins (~hedgehog@2604:a840:3::1061)
18:37:40 finn_elija joins (~finn_elij@user/finn-elija/x-0085643)
18:37:40 × FinnElija quits (~finn_elij@user/finn-elija/x-0085643) (Killed (NickServ (Forcing logout FinnElija -> finn_elija)))
18:37:40 finn_elija is now known as FinnElija
18:39:35 <Raito_Bezarius> does instance (MonadPlus m, Monoid e) => MonadPlus (ExceptT e m) exist somewhere in base libs?
18:39:49 <Raito_Bezarius> so that a + b lifts the + of the value
18:39:59 <Raito_Bezarius> (use case: ExceptT e (List a))
18:41:01 × CiaoSen quits (~Jura@p200300c957347b002a3a4dfffe84dbd5.dip0.t-ipconnect.de) (Ping timeout: 240 seconds)
18:43:53 <monochrom> It already exists. You just have to import, for example, Control.Monad.Except
18:44:46 <monochrom> It is also more general: instance (Monad m, Monoid e) => MonadPlus (ExceptT e m)
18:45:58 × tromp quits (~textual@dhcp-077-249-230-040.chello.nl) (Quit: My iMac has gone to sleep. ZZZzzz…)
18:47:26 toastloop joins (toastloop@user/toastloop)
18:48:20 cfricke joins (~cfricke@user/cfricke)
18:50:20 × cfricke quits (~cfricke@user/cfricke) (Client Quit)
18:50:36 cfricke joins (~cfricke@user/cfricke)
18:50:47 merijn joins (~merijn@83-160-49-249.ip.xs4all.nl)
18:54:24 <Raito_Bezarius> I read this instance but it didn't look like that except1 + except2 would merge the result, monochrom
18:54:45 × eron quits (~eron@186.192.87.8) (Ping timeout: 256 seconds)
18:54:46 <Raito_Bezarius> how do you read: https://hackage.haskell.org/package/transformers-0.6.0.2/docs/src/Control.Monad.Trans.Except.html#line-248 ?
18:54:56 <Raito_Bezarius> the Left e -> liftM … seems to ignore mx
18:55:17 × merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 240 seconds)
18:56:13 <monochrom> "Left . mappend e" where e came from "Left e" where "Left e" came from "ex" where "ex <- mx" does not look remotely like ignoring mx to me.
18:56:38 Erutuon joins (~Erutuon@user/erutuon)
18:56:46 <monochrom> How do I read it? It mappends the error of mx and the error of my.
18:59:18 × machinedgod quits (~machinedg@24.105.81.50) (Remote host closed the connection)
18:59:44 <Raito_Bezarius> damn thanks monochrom
19:00:15 machinedgod joins (~machinedg@24.105.81.50)
19:00:30 <Raito_Bezarius> and why Right x -> return (Right x) does the right thing wrt to mappend?
19:00:36 <Raito_Bezarius> for my
19:00:45 <Raito_Bezarius> sorry for the dumb question
19:01:48 <monochrom> What is the type of x? Is it e?
19:02:09 × justsomeguy quits (~justsomeg@user/justsomeguy) (Quit: WeeChat 3.3)
19:02:57 <Raito_Bezarius> it's m
19:05:40 × bitdex quits (~bitdex@gateway/tor-sasl/bitdex) (Remote host closed the connection)
19:05:58 × cfricke quits (~cfricke@user/cfricke) (Quit: WeeChat 3.3)
19:06:18 bitdex joins (~bitdex@gateway/tor-sasl/bitdex)
19:17:42 × azimut quits (~azimut@gateway/tor-sasl/azimut) (Remote host closed the connection)
19:18:05 azimut joins (~azimut@gateway/tor-sasl/azimut)
19:22:36 cfricke joins (~cfricke@user/cfricke)
19:25:53 nahtnam joins (~nahtnam@104-180-254-7.lightspeed.sntcca.sbcglobal.net)
19:27:38 tromp joins (~textual@dhcp-077-249-230-040.chello.nl)
19:28:08 merijn joins (~merijn@83-160-49-249.ip.xs4all.nl)
19:29:02 × FinnElija quits (~finn_elij@user/finn-elija/x-0085643) (Killed (NickServ (Forcing logout FinnElija -> finn_elija)))
19:29:02 finn_elija joins (~finn_elij@user/finn-elija/x-0085643)
19:29:02 finn_elija is now known as FinnElija
19:30:31 <hololeap> Raito_Bezarius: what you're looking for actually only requires Applicative
19:30:35 <hololeap> :t liftA2 (<>)
19:30:36 <lambdabot> (Applicative f, Semigroup c) => f c -> f c -> f c
19:31:20 bitmapper joins (uid464869@id-464869.lymington.irccloud.com)
19:31:42 × lbseale quits (~ep1ctetus@user/ep1ctetus) (Ping timeout: 260 seconds)
19:31:47 mvk joins (~mvk@2607:fea8:5cdd:f000::917a)
19:31:56 <hololeap> :t liftA2 (<>) (Right (Sum 4)) (Right (Sum 5))
19:31:57 <lambdabot> Num a1 => Either a2 (Sum a1)
19:32:04 <hololeap> > liftA2 (<>) (Right (Sum 4)) (Right (Sum 5))
19:32:06 <lambdabot> Right (Sum {getSum = 9})
19:32:30 deadmarshal joins (~deadmarsh@95.38.231.102)
19:33:20 <nahtnam> Hello! Has anyone been able to get yesod working on an M1 mac? I'm trying with stack and I just cannot get it working. I do `stack new stock-checker yesodweb/postgres`. Then I do `stack install yesod-bin --install-ghc` which fails due to `Cocao` not being installed. I looked around and to fix this I run `stack config set resolver lts`. Then the
19:33:21 <nahtnam> previous yesod bin command works. Then I try to do `stack build` which gives me a bunch of inter-dependency issues. I tried copy and pasting them into `extra-deps` but it seems like a circular thing. Finally it starts to build but then fails with presistent PostgreSQL with this issue: "symbol not found in flat namespace '_PQbackendPID'" and I can't
19:33:21 <nahtnam> seem to figure this one out
19:34:49 <Raito_Bezarius> ah thx, hololeap !
19:36:17 <hololeap> Raito_Bezarius: you might also be interested in Ap from Data.Monoid, which has a Monoid instance for (Applicative f, Monoid a) => Ap f a
19:36:38 <hololeap> basically, (<>) = liftA2 (<>) ; mempty = pure mempty
19:37:20 <Raito_Bezarius> what would be a idiomatic way to move forward wrt 19:39 in your eyes hololeap ?
19:37:31 <Raito_Bezarius> should I do an instance for MonadPlus with Applicative?
19:39:04 <hololeap> well, ExceptT doesn't actually fit the MonadPlus abstraction, because there's no general way to define what mzero is
19:40:35 × cfricke quits (~cfricke@user/cfricke) (Quit: WeeChat 3.3)
19:41:39 <hololeap> wait, no I'm wrong
19:42:18 <hololeap> anyway that instance of MonadPlus is already defined in Control.Monad.Trans.Except
19:43:35 <Raito_Bezarius> yes
19:43:40 <Raito_Bezarius> but how does it actually merge the results?
19:43:50 <Raito_Bezarius> (cc 19:54 and 20:00)
19:44:52 <hololeap> you can use either <|> (from the Alternative typeclass) or mplus (from MonadPlus)
19:45:08 <hololeap> but it's not entirely clear how you want it to behave
19:45:53 <Raito_Bezarius> In the context of ExceptT e (List a), I'd like to add two ExceptT so that it merges the value if they are both Right _
19:46:27 <Raito_Bezarius> i.e. a1 a2 :: ExceptT e (List a) ; a1 `mplus` a2 == Right (value a1 ++ value a2) ; something along these lines
19:46:28 <hololeap> in that case you don't want to use Alternative or MonadPlus, but just plain old liftA2
19:46:45 <Raito_Bezarius> Right
19:46:54 <hololeap> if you used Alternative/MonadPlus it would just return the first Right value and would skip the second one
19:47:21 <Raito_Bezarius> that was exactly what I said at 19:54, but monochrom said otherwise so I got confused
19:47:27 <hololeap> > Right [1,2,3] `mplus` Right [4,5,6]
19:47:29 <lambdabot> error:
19:47:29 <lambdabot> • Ambiguous type variable ‘a0’ arising from a use of ‘show_M802144840221...
19:47:29 <lambdabot> prevents the constraint ‘(Show a0)’ from being solved.
19:47:52 <hololeap> eh, bad example
19:48:25 <hololeap> it might be easier to illustrate with Maybe
19:48:38 <hololeap> > Just [1,2,3] `mplus` Just [4,5,6]
19:48:40 <lambdabot> Just [1,2,3]
19:48:59 <hololeap> > liftA2 (<>) (Just [1,2,3]) (Just [4,5,6])
19:49:00 <lambdabot> Just [1,2,3,4,5,6]
19:50:58 <Raito_Bezarius> hmm
19:51:02 <Raito_Bezarius> what happens when there is two errors hololeap ?
19:51:05 <Raito_Bezarius> are *
19:51:13 <Raito_Bezarius> can I get the two errors *and* the two values?
19:51:43 <hololeap> not with ExceptT but there is another data structure that can do that...
19:51:55 <hololeap> if I can remember its name
19:52:01 <geekosaur> Chronicle?
19:52:13 <geekosaur> although there are others like it
19:52:22 <geekosaur> These
19:53:39 <geekosaur> Chronicle is a swiss army knife; These is the simple version
19:53:55 <Raito_Bezarius> nice
19:54:09 <hololeap> @hackage monad-chronicle
19:54:10 <lambdabot> https://hackage.haskell.org/package/monad-chronicle
19:54:32 <geekosaur> the real question is whetheryour operations make continuing after an error meaningful or not
19:54:36 <hololeap> yeah that's it
19:57:53 <dminuoso> I was tempted to use monad-chronicle, but found it was easier to model these effects manually and maintain IORefs of critical errors, errors and warnings.
19:59:06 × tromp quits (~textual@dhcp-077-249-230-040.chello.nl) (Quit: My iMac has gone to sleep. ZZZzzz…)
19:59:46 × Vajb quits (~Vajb@hag-jnsbng11-58c3a8-176.dhcp.inet.fi) (Read error: Connection reset by peer)
19:59:56 Vajb joins (~Vajb@hag-jnsbng11-58c3a8-176.dhcp.inet.fi)
20:01:55 <Raito_Bezarius> geekosaur: in my context, yes, I want to collect all errors
20:02:11 syrkis joins (~syrkis@109.59.170.168.mobile.3.dk)
20:02:14 × merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 252 seconds)
20:02:47 × waleee quits (~waleee@2001:9b0:21d:fc00:398f:b003:b90d:acf4) (Ping timeout: 252 seconds)
20:03:07 × wroathe quits (~wroathe@user/wroathe) (Ping timeout: 250 seconds)
20:04:50 waleee joins (~waleee@h-98-128-229-110.NA.cust.bahnhof.se)
20:05:09 × juhp quits (~juhp@128.106.188.82) (Ping timeout: 256 seconds)
20:06:23 × syrkis quits (~syrkis@109.59.170.168.mobile.3.dk) (Quit: Client closed)
20:06:28 <dminuoso> Raito_Bezarius: https://gist.github.com/dminuoso/b273e3a00a0542c4dceda3d98fa56cc0
20:06:33 <dminuoso> This is how we do this manually
20:06:43 juhp joins (~juhp@128.106.188.82)
20:06:53 <Raito_Bezarius> Thanks dminuoso!
20:06:53 <dminuoso> It's quite simple and yet gives us full power.
20:07:39 <Raito_Bezarius> Indeed!
20:07:42 <dminuoso> Raito_Bezarius: So our program is split into three phases, and each phase tries to complete even in the presence of errors (to try and collect as many errors as possible)
20:08:05 <dminuoso> But we can only proceed into the next phase if there's no errors in the previous one (because each phase has certain preconditions that must be met)
20:08:09 <Raito_Bezarius> Correct, I'm in a similar context
20:11:23 × Megant quits (megant@user/megant) (Ping timeout: 256 seconds)
20:12:50 <dminuoso> Raito_Bezarius: So we then have this small combinator: https://gist.github.com/dminuoso/e2e3fc9071e3afaccaa182cc7ad071c5
20:12:50 Megant joins (megant@user/megant)
20:12:51 <hololeap> Raito_Bezarius: from everything you've said, it sounds to me like you're at a point in your learning where you should read through Typeclassopedia
20:12:58 <hololeap> https://wiki.haskell.org/Typeclassopedia
20:13:16 <dminuoso> Raito_Bezarius: And then we can do something like `Nothing <$ configErr "Stuff is broken"`
20:13:31 <hololeap> it will clear up any confusion surrounding Applicative vs Alternative vs Monad vs MonadPlus, etc
20:14:17 <dminuoso> (We even have a typeclass to generate useless defaults, where we can simply say `configErrDef "foo"`, and this will produce some bogus value as a result, while setting an error.
20:14:23 kupi joins (uid212005@id-212005.hampstead.irccloud.com)
20:15:08 <dminuoso> i.e. when for some reason you *must* produce something of type String, you might have: "<nonexistant>" <$ configErr "failed to extract text"
20:15:09 kadir joins (~kadir@88.251.54.120)
20:16:27 tromp joins (~textual@dhcp-077-249-230-040.chello.nl)
20:18:42 <Raito_Bezarius> Thanks hololeap
20:26:39 chexum joins (~quassel@gateway/tor-sasl/chexum)
20:26:51 × chexum_ quits (~quassel@gateway/tor-sasl/chexum) (Ping timeout: 276 seconds)
20:27:44 jgeerds_ joins (~jgeerds@55d4ac73.access.ecotel.net)
20:27:48 × tromp quits (~textual@dhcp-077-249-230-040.chello.nl) (Quit: My iMac has gone to sleep. ZZZzzz…)
20:29:37 tromp joins (~textual@dhcp-077-249-230-040.chello.nl)
20:30:15 × nahtnam quits (~nahtnam@104-180-254-7.lightspeed.sntcca.sbcglobal.net) (Quit: Client closed)
20:30:25 <tomsmeding> What's currently the most reliable way to get GHC working on apple M1, with either stack or cabal (don't care)? I don't have such hardware but a student is asking. Sorry for being the 1e6'th person asking for this, perhaps maerwald knows?
20:32:17 <geekosaur> 8.10.7
20:32:59 <geekosaur> it should just work, with either stack or cabal. beware of x86_64 binaries or dylibs lying around somewhere
20:33:15 <g> ghcup will install it just fine, but it doesn't appear to be a seamless experience however you install it
20:33:48 <geekosaur> make sure your stack or cabal is built for the m1, as an x86_64 one will force the build to be under rosetta
20:33:59 evocatus joins (~evocatus@62.182.78.42)
20:38:20 merijn joins (~merijn@83-160-49-249.ip.xs4all.nl)
20:38:20 <tomsmeding> g, geekosaur: thanks! So I should be able to recommend the standard ghcup install procedure, and tell them to take care to get ghc 8.10.7?
20:38:38 <geekosaur> yes
20:38:44 <tomsmeding> In other words, will ghcup automatically get the m1 version
20:38:47 <tomsmeding> Awesome, thanks!
20:39:11 <geekosaur> in particular, 9.2.1 has native support for the m1, but that support was found to be buggy (builds but the result crashes) after release, so avoid it
20:39:38 <geekosaur> sign extension bugs
20:40:42 pavonia joins (~user@user/siracusa)
20:41:34 <tomsmeding> The student tried something else before (cabal and ghc 8.10.7, not sure how they got those things) and got errors that transformers-compat needs llvm [9,13); does that sound familiar?
20:41:56 <geekosaur> iirc you have to point it to /opt/llvm to get a full llvm
20:42:57 × merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 240 seconds)
20:43:16 <tomsmeding> s/transformers-compat/colour/
20:43:43 <tomsmeding> geekosaur: is there already a full llvm there on a standard macos install, or do you need to point something else there?
20:44:37 <sm> tomsmeding: echoing geekosaur's warning, if they already installed another way they likely have intel binaries lurking in path, best to clean those out carefully to avoid breakages
20:44:55 <tomsmeding> Right
20:45:35 <sm> standard macos comes with llvm 13 I think (or maybe after doing xcode-select --install) but I seemed to need to install it again from brew
20:46:33 lavaman joins (~lavaman@98.38.249.169)
20:46:53 <tomsmeding> Oh I read some comment from angerman on reddit saying that you need to install a full llvm separately anyway?
20:47:16 <sm> (ps not just binaries but also cached artifacts in .cabal, .stack, .cache/hie-bios..)
20:47:19 <geekosaur> not sure. at one point someone said there were two versions of llvm under /opt
20:47:30 <geekosaur> but installing it via brew might be easiest anyway
20:48:17 <geekosaur> (sorry, had to go downstairs and pick up a package)
20:48:25 <tomsmeding> geekosaur: as in, `brew install llvm`?
20:48:59 <geekosaur> I don't know details, I haven't used Macs for years and when I did I used MacPorts
20:49:03 <sm> yes
20:49:35 <tomsmeding> sm: thanks, I'll go back and forth with them and come back if we can't figure it out!
20:49:39 <tomsmeding> Thanks all
20:50:01 × dsrt^ quits (~dsrt@64.253.22.77) (Remote host closed the connection)
20:50:08 <sm> np, cf recent m1 thread on /r/haskell
20:50:37 × lavaman quits (~lavaman@98.38.249.169) (Ping timeout: 240 seconds)
20:50:54 × fef quits (~thedawn@user/thedawn) (Ping timeout: 276 seconds)
20:53:28 × tromp quits (~textual@dhcp-077-249-230-040.chello.nl) (Quit: My iMac has gone to sleep. ZZZzzz…)
20:53:32 <tomsmeding> sm: the one with xeltius as OP?
20:53:33 qrpnxz parts (abc4f95c31@user/qrpnxz) (Disconnected: closed)
20:53:40 qrpnxz joins (abc4f95c31@user/qrpnxz)
20:55:15 kadir parts (~kadir@88.251.54.120) (goodnight)
20:58:32 × _ht quits (~quassel@82-169-194-8.biz.kpn.net) (Remote host closed the connection)
21:00:06 vicfred joins (~vicfred@user/vicfred)
21:00:23 <jollygood2> I have {-# Language OverloadedLists #-} on the of the .hs file, but when I load that file in ghci [1,2,3] is to Num a => [a]. how come?
21:00:34 <jollygood2> s/to//
21:00:40 <sm> https://www.reddit.com/r/haskell/comments/rjm0x8/help_wanted_for_llvm_config_for_haskell_on_mac/, tomsmeding
21:00:57 <dsal> % :set -XOverloadedLists
21:00:57 <yahb> dsal:
21:01:01 <dsal> % :t [1,2,3]
21:01:01 <yahb> dsal: (IsList l, Num (Item l)) => l
21:01:17 <dsal> jollygood2: Oh. That's within the file, not within ghci
21:01:26 <dsal> That stuff is all pretty well self-contained.
21:01:31 <jollygood2> that worked, but why isn't ghci autoloading that extension
21:01:38 <dsal> Because it definitely shouldn't.
21:01:48 <jollygood2> I disagree
21:01:57 <dsal> ghci can pull the symbols out of your file, but it doesn't change the language it interprets based on the file.
21:02:03 <dsal> What if you read two files that have conflicting extensions enabled?
21:02:54 <geekosaur> :seti -XOverloadedLists ?
21:03:10 <dsal> I think it'll also honor anything you put in your project config.
21:03:17 <dsal> But file specific should always be file specific.
21:03:18 <geekosaur> the language parsed interactively is not that of any source file, as dsal said
21:03:29 <jollygood2> dsal, doesn't loading a new file lose all the information about the previously loaded file
21:03:37 <tomsmeding> sm: yay thanks, that looks highly relevant! (Spotted your top comment.) Passing on!
21:03:39 <geekosaur> you can have multiple files loaded
21:03:52 <geekosaur> which one wins?
21:05:36 <jollygood2> I just loaded two files one after another. I can't call any functions from the first file, after loading a second one
21:07:23 <geekosaur> you can't use :l, but you can use :m *
21:07:39 <geekosaur> now you have two or more files loaded as source. again: which one wins?
21:08:00 <geekosaur> also, if you load them as binary instead of source, it can't know which extension(s) were enabled during compile
21:08:57 × eggplantade quits (~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net) (Remote host closed the connection)
21:09:06 <jollygood2> since I never load more than one file, or even knew I could do that, I don't particularly care. but having to manually enable extensions is inconvenient. maybe this should be ghci option
21:09:35 <geekosaur> https://downloads.haskell.org/ghc/latest/docs/html/users_guide/ghci.html#setting-options-for-interactive-evaluation-only
21:09:55 <hololeap> it would be a nice feature if cabal repl could "zoom into" a module and the interpreter behaves with the scope of that module, e.g. all imports/extensions/functions for that module are enabled/in scope
21:10:57 dschrempf joins (~dominik@070-207.dynamic.dsl.fonira.net)
21:11:03 <dsal> jollygood2: You can specify the extensions you want to use in your package.yaml or .cabal file and then you have them in ghci and don't have to specify them in each file. But I wouldn't want OverloadedLists without being super aware of it.
21:11:17 <sm> +1. (:m +* supporting extensions)
21:11:32 <hololeap> yeah overloadedlists bites you more often than not
21:11:52 <sm> (uh, unless geekosaur just explained why that can't work. But I still want it)
21:12:53 <geekosaur> modules loaded with * and therefore compiled a ssource ought to be able to do it. but I'd want to be told what extensions have been automatically enabled/disabled when I switch scopes, rather than spooky action at a distance
21:13:12 tromp joins (~textual@dhcp-077-249-230-040.chello.nl)
21:13:19 merijn joins (~merijn@83-160-49-249.ip.xs4all.nl)
21:13:29 × kaph_ quits (~kaph@net-2-47-236-216.cust.vodafonedsl.it) (Ping timeout: 268 seconds)
21:13:35 <geekosaur> *especially* if it's something like OverloadedLists. or worse, RebindableSyntax which OverloadedLists is a subset of
21:13:39 regr joins (~regr@user/regr)
21:15:45 <geekosaur> also there's at least one current exception that would need to be thought about: NoMonomorphismRestriction is default interactively but not in files
21:15:48 <sm> geekosaur: agreed, that would be great. I've regroupd and typed :set -X[No]LongCaseSensitiveName more than enough
21:19:09 <monochrom> You can load multiple files by using :add
21:20:47 <monochrom> Also the design of ghci is such that the notion of loading is somewhat detached from the notion of in-scope. :module is about in-scope.
21:21:04 <monochrom> This means there are times you have to say both :add and :module
21:21:15 <geekosaur> also I'm not sure "all imports" is currently possible. I tried to access xmonad imports with my cabalized setup and failed, no amount of --package etc. seemed to help. (packages were of course visible in cabal file)
21:22:18 <EvanR> I've got a cabal script .hs file I want to load into ghci...
21:22:29 nitrix is now known as nitrix-mas
21:22:40 <EvanR> rather than execute as is
21:22:41 <monochrom> The said design may be bad, but it has the merit of acknowledging the following issue: :module is valid for modules from installed packages, :load isn't.
21:22:54 <geekosaur> hm, I don't think either cabal or stack will do that with scripts currently
21:23:06 × tromp quits (~textual@dhcp-077-249-230-040.chello.nl) (Quit: My iMac has gone to sleep. ZZZzzz…)
21:23:08 toastloopex joins (toastloop@user/toastloop)
21:23:09 <monochrom> And generally acknowledging the invalidity of DWIM.
21:23:30 <sm> with stack, it's stack --package A --package B ghci script.hs, I think
21:23:30 <EvanR> can I run ghci and load package vector... even if it's "hidden"
21:23:47 <monochrom> I think I heard that stack scripts can be "stack repl"ed.
21:23:56 <geekosaur> ghci -package vector-x.y.z
21:26:26 × toastloop quits (toastloop@user/toastloop) (Ping timeout: 268 seconds)
21:27:08 <EvanR> There is no package.cache... There are no .conf files... cannot satisfy -package vector
21:27:23 <EvanR> or vector-0.12.3.1
21:27:40 <EvanR> yes, I don't understand cabal
21:27:56 <sm> what was your command line ?
21:28:00 <monochrom> Yeah "-package vector-..." requires either having done "cabal install --lib vector-..." or manually playing with -package-db flags.
21:28:02 <ProfSimm> When I make a record, Haskell generates field accessors automatically as functions. Where are those functions defined actually, who has access to them?
21:28:06 <geekosaur> if you are using cabal repl, it should be --package vector
21:28:07 <EvanR> ghci -v -package vector-0.12.3.1
21:28:19 <Raito_Bezarius> Many thanks dminuoso
21:28:53 <monochrom> "cabal install --lib" is not very harmful. Perhaps it's the least resistant option.
21:29:15 <geekosaur> ProfSimm, they are ordinary functions with the same scope as anything you define at top level in your file, and will for example be exported if you have no (== default) export list
21:29:20 <nitrix-mas> ProfSimm, Same module the record type is defined in. Import/exports of those functions works in the same way the type does as well.
21:29:20 <geekosaur> Or you can export them explicitly
21:29:30 <EvanR> cabal repl --package vector, them import Data.Vector or :load MyFile.hs results in Could not load Data.Vector something something hidden package
21:29:37 <sm> when the cabal script runs, which package db is it using ? the user package db for the ghc in PATH, I would have though
21:29:38 <ProfSimm> Thanks.
21:29:39 qrpnxz parts (abc4f95c31@user/qrpnxz) (Disconnected: closed)
21:29:59 qrpnxz joins (abc4f95c31@user/qrpnxz)
21:30:11 <monochrom> You won't have a filename-and-line-number answer for "where", if that's what you mean.
21:30:12 <EvanR> well, doing cabal repl I don't expect it to treat the file as a cabal script
21:30:33 <geekosaur> that's pretty much the only thing I would expect *to* treat it as one
21:30:35 <monochrom> Compiler auto-gen'ed code that exists only in *.o files.
21:30:41 <geekosaur> nothing else would know it was a cabal script
21:30:42 <EvanR> cabal v2-run ?
21:31:05 <monochrom> Similarly "data X = X deriving (Ord, Eq, Show, Read)" where is the instance code?
21:31:06 <geekosaur> in particular bare ghci will think it's an ordinary Haskell source file and ignore the cabal-script stuff entirely
21:31:19 <EvanR> makes sense
21:31:22 eggplantade joins (~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net)
21:32:27 <monochrom> OK, who has access. A better question is: What is its scoping rules.
21:32:29 <EvanR> monochrom suggested something like, install vector globally
21:32:46 <monochrom> It is firstly in scope in the module that defines that record type.
21:33:07 <monochrom> And then that module can choose to export or not export it. Default is export.
21:33:20 <sm> EvanR: isn't vector already installed globally , since the script runs by itself ?
21:33:47 <monochrom> Yeah but ghci consults the "environment" file.
21:34:10 <monochrom> In which case "cabal install --lib vector" has a job of updating that environment file.
21:34:13 <EvanR> I guess it's installed due to my previous cabal scripts?
21:34:18 <sm> right.. so maybe you're in a project directory EvanR ?
21:34:19 <monochrom> Yeah.
21:34:35 <EvanR> no project files in sight
21:34:41 <monochrom> Well if someone uses ghci directly, maybe they don't want a "project".
21:34:42 <EvanR> just .hs file
21:34:52 <sm> ghc-pkg list <- includes vector ?
21:35:06 <EvanR> no vector
21:35:23 <monochrom> "cabal run script.hs" causes building vector but not entering it into the "environment file".
21:35:23 <EvanR> I've only installed it in projects and used it from scripts
21:35:26 <sm> it seems you have multiple package dbs in play, one way or other
21:35:34 <geekosaur> ghc-pkg list doesn't include environment files, that's an open ghc ticket
21:35:45 <EvanR> environment file...
21:35:55 <EvanR> why didn't I think of that...
21:36:03 sm laments the overwhelming cunning of haskell tools, humans do not have much chance
21:36:25 <monochrom> Isn't this like common knowledge for 5 years already?
21:36:42 <sm> ha, easy to say
21:36:55 <EvanR> Can I have a listing of all common knowledge
21:36:59 <sm> I've never used an environment file
21:37:08 <monochrom> I am saying this as someone who wanted to have nothing to do with cabal v2 until like a year ago.
21:37:21 <sm> and even if I had I would still forget about them at times like this
21:38:05 <EvanR> before we delve into a metatoolingrant, what does the potential existence of this "environment file" mean to me right now
21:38:45 <EvanR> is vector installed? xD
21:38:58 <EvanR> I mean i've been using it for a few months
21:39:00 <monochrom> It helps you use ghci directly and still enjoy a cabal-v1-like experience of "install a lib, then ghci sees it".
21:39:40 × jgeerds_ quits (~jgeerds@55d4ac73.access.ecotel.net) (Quit: Leaving)
21:39:47 <monochrom> OK, maybe the following helps.
21:39:48 <EvanR> that's handy I guess
21:39:48 jgeerds joins (~jgeerds@55d4ac73.access.ecotel.net)
21:40:01 <monochrom> Take a look at $HOME/.cabal/store/ghc-<version>
21:40:24 <monochrom> You will find a lot of library packages there. And a package database too to go with them.
21:40:27 <EvanR> I have 3 vectors two with the same version
21:40:44 <monochrom> Clearly, ghci by default doesn't even know that this place exists.
21:41:16 <sm> EvanR: if you're not in a project, why/where do you have an environment file ? just curious
21:41:33 <monochrom> Now you have 2 options. For "--lib", turn to page 13. For "cabal 'project'", turn to page 7.
21:41:47 <EvanR> sm, I only just heard of an environment file
21:41:59 <EvanR> I don't see any file called environment anywhere
21:42:10 × ProfSimm quits (~ProfSimm@87.227.196.109) (Remote host closed the connection)
21:42:14 <sm> oh. I thought you had discovered one causing the problem
21:42:18 <EvanR> no
21:42:24 <monochrom> Page 13: "cabal install --lib" updates a file under $HOME/.ghc to point ghci to the existence of some of those packages, very selectively. You can do very fine-grained control.
21:42:39 <EvanR> well I know how to make a cabal project
21:42:47 <monochrom> Page 7: "cabal build" calls ghc with enough -package-db flags to tell ghc the existence of that place.
21:43:15 <EvanR> -package-db flags, got it
21:43:37 <monochrom> -package-db flags are not normally meant for human use. :)
21:44:02 <monochrom> Then again, I still do it once in a while. Even wrote a few bash aliases to help.
21:45:04 × tomku quits (~tomku@user/tomku) (Quit: leaving)
21:45:12 <EvanR> interesting there's nothing really under ~/.ghc
21:45:35 tomku joins (~tomku@user/tomku)
21:45:37 <EvanR> an empty package.cache.lock file
21:46:03 <monochrom> You have multiple vectors of the "same" "version" because if its build dependencies changes by just a little bit, a rebuild is called for. Each build is crytpo-hashed with the exact backgrounds of the build. This is to solve cabal hell.
21:46:18 <EvanR> cool
21:46:52 <EvanR> but it sounds like that spells trouble for "just load a haskell file that uses vector"
21:47:30 × merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 260 seconds)
21:48:14 <EvanR> and a .cabal file is cool but still non-non-existent part of a small workflow
21:48:18 <monochrom> The environment file will refer to just one of the builds.
21:48:19 <sm> my approach to that is `cd; stack ghci FILE --package vector`. This is pretty reliable, it must be possible to do something similar with cabal
21:48:41 <monochrom> At worst it refers to an old build you don't want to use any more.
21:48:57 <EvanR> is The environment file unique?
21:48:58 <monochrom> But you can always edit the env file and delete that line.
21:49:01 <monochrom> Yes.
21:49:13 <sclv> `cabal repl -b` is the equiv to `stack ghci --package`
21:49:46 <sm> there ^
21:49:57 <EvanR> cabal repl doesn't take any extra arguments when outside a project
21:50:39 <sclv> right, don't pass in the file for ghci to load
21:50:41 <sm> waaaah
21:50:46 <sclv> it'll open a clean ghci with all the packages in scope
21:50:55 <sclv> and from within ghci, hit `:load path/to/File.hs`
21:51:09 <monochrom> Oh, cool trick, haha, didn't think of that.
21:51:43 <EvanR> that actually worked
21:51:56 × dschrempf quits (~dominik@070-207.dynamic.dsl.fonira.net) (Quit: WeeChat 3.3)
21:51:57 <EvanR> what the hell does -b stand for
21:52:06 <sclv> --build-depends
21:52:14 <EvanR> wow
21:52:25 <sclv> so you can give it `containers > 2` etc
21:52:40 <sm> victory \o/
21:52:54 <sclv> and note it runs the solver under the hood so you can depend on some beefy collection of packages and it'll solve and build the deps for you
21:53:04 <EvanR> yeah ok... final question, have we been talking about "the .ghci file" this whole time
21:53:05 <monochrom> The other cool trick I learned today is from the Giry monad file int-e pointed me to. Under Dirac measure, say "unit x", a predicate is true a.e. iff it is true at x. Because the whole point of a Dirac measure is to ignore everything else haha.
21:53:22 <tomsmeding> You can also 'cabal repl -b vector --repl-options yourfile.hs' iirc
21:53:57 <tomsmeding> monochrom: what does a.e. stand for?
21:53:57 <sm> confirmed, tomsmeding
21:54:52 <tomsmeding> Ah, almost everywhere
21:54:57 <monochrom> "almost everywhere". The technical definition is: A predicate holds "a.e." iff the set of where it doesn't hold has zero measure.
21:55:04 <tomsmeding> Right
21:55:25 <monochrom> So, the complement of {x} has zero measure!
21:55:46 yauhsien joins (~yauhsien@118-167-43-174.dynamic-ip.hinet.net)
21:55:56 <monochrom> More like "ignore almost everywhere except x". :)
21:56:00 wroathe joins (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net)
21:56:00 × wroathe quits (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Changing host)
21:56:00 wroathe joins (~wroathe@user/wroathe)
21:56:01 <tomsmeding> The fact that "almost everywhere" has a rigorous definition can be used as a lousy party trick among amateur mathematicians
21:56:35 <sm> EvanR: I didn't notice anyone talking about "the .ghci file" ?
21:56:40 <EvanR> ok then I'm wrong
21:56:48 <monochrom> Well, not sure we should blame it on "a.e." or we should blame it on the very degenerate Dirac measure. :)
21:57:11 <EvanR> if I carry on right now, I still won't know wtf an environment file is
21:57:23 <EvanR> is it called "environment" or where would it go
21:57:34 <EvanR> no duckduckgo results about it
21:57:38 <sm> good, best avoid it if you can
21:57:44 <EvanR> alright then it's bad
21:57:52 <sclv> its a different approach thats slick when it works
21:57:54 <EvanR> stricken from the record
21:58:07 <monochrom> So, the sifting property "f x = integrate f using (unit x) as the measure" has a lousy party trick proof: f = const (f x) a.e.
21:58:08 <sm> https://cabal.readthedocs.io/en/3.6/cabal-project.html?highlight=environment#cfg-field-write-ghc-environment-files
21:58:08 <sclv> but its not so easy to use still, so the other options presented are easier
21:58:09 <geekosaur> but bites your butt hard when it doesn't
21:58:27 × takuan quits (~takuan@178-116-218-225.access.telenet.be) (Remote host closed the connection)
21:58:51 <sclv> its a sad case where "do what i mean" can cause the XX% of cases when that isn't what you meant to be confusing
21:59:49 <monochrom> EvanR: If you have an environment file, then when you start ghci, it has the message "Loaded package environment from ..." and it spells out the exact pathname.
22:00:17 × yauhsien quits (~yauhsien@118-167-43-174.dynamic-ip.hinet.net) (Ping timeout: 240 seconds)
22:00:27 <EvanR> Ok, it looks gnarly
22:00:31 <EvanR> will do -b
22:05:47 kjak joins (~kjak@pool-108-45-56-21.washdc.fios.verizon.net)
22:05:48 <EvanR> interesting, Vector's show instance looks like List's?
22:07:09 toastlooply joins (toastloop@user/toastloop)
22:07:23 <monochrom> It adds a "fromList" but yeah.
22:07:44 <monochrom> No one wants to invent a really innovative notation!
22:08:04 <monochrom> And under the spell of "it should look like Haskell code".
22:08:15 <geekosaur> they'd have to get ghc{,i} to recognize it :)
22:08:30 <geekosaur> or someone would inevitably try to type it in
22:09:07 <EvanR> I'm not seeing the "fromList " part...
22:09:53 <EvanR> so I thought I messed up and made a list
22:10:23 × toastloopex quits (toastloop@user/toastloop) (Ping timeout: 256 seconds)
22:10:49 <monochrom> Hrm, you're right, I misremembered.
22:12:02 tromp joins (~textual@dhcp-077-249-230-040.chello.nl)
22:12:04 × wroathe quits (~wroathe@user/wroathe) (Ping timeout: 268 seconds)
22:16:36 × coolnickname quits (uid531864@user/coolnickname) (Quit: Connection closed for inactivity)
22:16:57 × machinedgod quits (~machinedg@24.105.81.50) (Ping timeout: 240 seconds)
22:18:00 <EvanR> it's fun to see how other languages decided to 'show' their data structures
22:18:09 toastloopex joins (~toastloop@user/toastloop)
22:18:17 <EvanR> they're all special snowflakes
22:19:04 <EvanR> deep down we all use the same heap objects and pointers, just in different ways
22:19:21 <EvanR> and the pretty printers don't agree
22:20:57 × toastlooply quits (toastloop@user/toastloop) (Ping timeout: 240 seconds)
22:22:56 acidjnk joins (~acidjnk@p200300d0c7271e5539f4c4c5e28366d0.dip0.t-ipconnect.de)
22:23:46 × dhouthoo quits (~dhouthoo@178-117-36-167.access.telenet.be) (Quit: WeeChat 3.3)
22:24:49 × Morrow quits (~quassel@bzq-110-168-31-106.red.bezeqint.net) (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.)
22:26:18 Morrow joins (~quassel@bzq-110-168-31-106.red.bezeqint.net)
22:26:28 × Morrow quits (~quassel@bzq-110-168-31-106.red.bezeqint.net) (Remote host closed the connection)
22:31:22 <[itchyjunk]> Hi, I am curious about "higher order function" vs "first order function". Higher order functions take function as parameter or return one. a `+` can return a partial function, wouldn't that make + a higher order function?
22:32:06 coot joins (~coot@2a02:a310:e03f:8500:5cc8:47c:8ec0:b827)
22:32:20 YehoshuaPesachWa is now known as yehoshuapw
22:32:32 qrpnxz parts (abc4f95c31@user/qrpnxz) (Disconnected: Replaced by new connection)
22:32:33 qrpnxz joins (abc4f95c31@user/qrpnxz)
22:32:50 <hpc> only in haskell
22:33:07 qrpnxz parts (abc4f95c31@user/qrpnxz) (Disconnected: closed)
22:33:10 qrpnxz joins (abc4f95c31@user/qrpnxz)
22:33:14 <hpc> (+) :: Num a => (a, a) -> a -- wouldn't be particularly higher-order at all
22:33:24 otherwise joins (~otherwise@c-73-181-170-174.hsd1.wa.comcast.net)
22:33:24 <hpc> and that's how other languages behave
22:33:25 lragyrlmtdwnbo^ joins (~lragyrlmt@64.253.22.77)
22:33:27 <[itchyjunk]> Ah, + in haskell is higher order function since it can return partial function?
22:33:34 <Rembane> [itchyjunk]: I would say that +4 evaluates to a function, it's not the function itself that returns a new function.
22:33:45 <[itchyjunk]> hmmm
22:34:11 <[itchyjunk]> Ah, i kinda see the distinction you're making there
22:34:19 <Rembane> If (+) is a higher order function then all functions in Haskell are higher order functions, except for the one hpc mentioned.
22:36:24 × gehmehgeh quits (~user@user/gehmehgeh) (Quit: Leaving)
22:37:38 <hpc> not all functions, but certainly all functions of "more than one" parameter
22:37:51 <hpc> here's another fun question for you
22:37:52 <hpc> :t id
22:37:53 <lambdabot> a -> a
22:38:01 × coot quits (~coot@2a02:a310:e03f:8500:5cc8:47c:8ec0:b827) (Remote host closed the connection)
22:38:02 <hpc> is that a higher-order function?
22:38:32 × tromp quits (~textual@dhcp-077-249-230-040.chello.nl) (Quit: My iMac has gone to sleep. ZZZzzz…)
22:39:25 <[itchyjunk]> well it takes a function and maps it to a function (itself)
22:39:28 coot joins (~coot@2a02:a310:e03f:8500:5cc8:47c:8ec0:b827)
22:39:31 <[itchyjunk]> so i should be a higher order function, no?
22:39:44 <hpc> maybe
22:39:50 <hpc> > id True -- or maybe it's not?
22:39:51 <lambdabot> True
22:40:11 <[itchyjunk]> oh
22:40:15 × toastloopex quits (~toastloop@user/toastloop) (Remote host closed the connection)
22:40:20 <[itchyjunk]> there, it didn't take a function but a value?
22:40:27 <hpc> yeah
22:40:31 <[itchyjunk]> ahhh
22:40:36 toastloopex joins (~toastloop@user/toastloop)
22:40:46 × eggplantade quits (~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net) (Remote host closed the connection)
22:41:07 <hpc> instead of getting too deep into defining these things exactly, perhaps look at it as "what is this language able to express?"
22:41:09 <[itchyjunk]> So it's a very context sensitive concept. great, makes sense!
22:41:17 <[itchyjunk]> hmmm
22:41:21 OscarZ joins (~oscarz@95.175.104.235)
22:41:45 <hpc> higher order functions make sense as a term when you're not able to have them, and think "what if you could?"
22:41:49 <[itchyjunk]> I don't think i understand the question. What are the types of things i can express? like turing completness?
22:42:13 <hpc> then once you get them, they're ultimately just yet more functions
22:42:37 × tomku quits (~tomku@user/tomku) (Ping timeout: 240 seconds)
22:42:44 <hpc> fuzzier than turing-completeness
22:42:58 lbseale joins (~ep1ctetus@user/ep1ctetus)
22:43:22 <hpc> for example, bash version 3 is turing-complete, but you can't express arrays properly in it
22:43:30 <hpc> (that was added in bash version 4)
22:43:41 <hpc> perl 4 didn't have pointers
22:43:43 nitrix-mas is now known as nitrix
22:43:50 <hpc> java 1.4 didn't have parametric polymorphism
22:43:57 <hpc> haskell 1.4 didn't have the IO type
22:44:06 <hpc> but all are turing complete
22:44:23 × deadmarshal quits (~deadmarsh@95.38.231.102) (Ping timeout: 256 seconds)
22:44:31 <[itchyjunk]> huh, interesting. so you could still do the same thing in each language, you just didn't have an inbuilt tool for it?
22:44:37 <hpc> yeah
22:44:56 <hpc> it's also why if you stick around here long enough, people talk about what you "can do" in theorem proving languages
22:44:58 <[itchyjunk]> does this mean i could implement higher order functions externally to any equivalently expressive language?
22:45:08 <hpc> when they aren't even turing-complete, so in a computational sense they are strictly lesser
22:45:10 <[itchyjunk]> oh interesting!
22:45:31 <hpc> you can emulate them in various ways, sure
22:45:34 <[itchyjunk]> i heard something about Coq not being turing complete. I would like to learn about theorem proving languages too!
22:45:43 <hpc> in C you might use function pointers for function parameters
22:46:03 <hpc> but then you'd have a yucky time trying to write a version of (+) that lets you partially apply it
22:47:01 × cosimone quits (~user@93-34-133-112.ip49.fastwebnet.it) (Quit: ERC (IRC client for Emacs 27.1))
22:48:30 qrpnxz parts (abc4f95c31@user/qrpnxz) (Disconnected: Replaced by new connection)
22:48:30 qrpnxz joins (abc4f95c31@user/qrpnxz)
22:48:59 <regr> yep, (safe) agda isn't turing complete either
22:49:02 qrpnxz parts (abc4f95c31@user/qrpnxz) (Disconnected: closed)
22:49:06 qrpnxz joins (abc4f95c31@user/qrpnxz)
22:49:08 tromp joins (~textual@dhcp-077-249-230-040.chello.nl)
22:52:15 falafel joins (~falafel@2603-8000-d800-688c-502d-7280-71cc-20e7.res6.spectrum.com)
22:52:53 <hololeap> this might be a stupid way of thinking of it, but I think of a higher order function as one that does not simply associate to the right. so I would consider `(a -> b) -> c` a higher-order function, but I would not consider `a -> (b -> c)` one since it simplifies to `a -> b -> c`
22:53:06 <regr> :t let {x :: Void; x = x} in x -- in haskell, you can 'make' an element of any type, even one without a constructor
22:53:07 <lambdabot> Void
22:54:10 <regr> and theorem prover people don't like it when you can do that, because it's basically like proving a falsehood (for example 4 = 5) which completely ruins their logic
22:54:19 <sm> off topic except discussion in here sent me on this tangent.. but isn't the first example at https://en.wikipedia.org/wiki/Chomsky_hierarchy#Formal_grammars wrong ? I don't see it producing "n copies of a followed by n copies of b"
22:54:32 philg joins (~philg@220.240.104.208)
22:55:00 <regr> so agda (and probably coq) check that every definition you make actually produces an answer (and many more things) to make sure you can't do that
22:55:19 <regr> which is why agda and coq aren't turing complete
22:55:25 <hpc> sm: it looks right to me
22:55:41 <sm> (phew, I do. n must be the same for both letters. carry on..)
22:56:00 <hpc> heh
22:56:08 <sm> thanks :)
22:56:35 × philg quits (~philg@220.240.104.208) (Client Quit)
22:56:51 philg joins (~philg@220.240.104.208)
22:56:57 philg is now known as FirstAsTragedy
22:57:12 <EvanR> [itchyjunk], you may have learned that a higher order function is one that takes a function as input. Now it's up to you do make of that what you will
22:57:25 × ridcully_ quits (~ridcully@pd951f824.dip0.t-ipconnect.de) (Ping timeout: 240 seconds)
22:57:30 ridcully joins (~ridcully@pd951fb88.dip0.t-ipconnect.de)
22:57:37 <hpc> (for the audience, if you expand the rules for A and B into the expansion for S, you get the second code block in that section which is obviously correct)
22:58:54 <EvanR> it seems normal in haskell, but see all the crazy terminology for this concept in e.g. math... where they call it a "functional"
22:59:39 <[itchyjunk]> ah, ill check out functionals
22:59:42 <EvanR> which sounds more like a word crashed on the part of speech highway
23:00:16 eggplantade joins (~Eggplanta@2600:1700:bef1:5e10:319d:53ed:6690:e5b4)
23:00:18 <hpc> it's like whoever was naming it forgot that verbs have conjugations
23:00:51 <hpc> "ah crap, we can't just name this after euler again"
23:01:31 <EvanR> hpc might be on the right track, what if aliens on venus invented functions (without regard to what they operate on), then a cool committee invented venusian C where functions could only operate on primitive types and pointers
23:01:39 <EvanR> they might call them "limited functions"
23:02:08 <EvanR> nothing higher order about the original functions
23:02:22 <hpc> heh
23:02:42 <hpc> or maybe it's the same person who decided to call it "maths"
23:03:03 <hpc> when the world inevitably ends in nuclear war, they'll have to learn to survive the "aftermaths" :D
23:03:35 × coot quits (~coot@2a02:a310:e03f:8500:5cc8:47c:8ec0:b827) (Remote host closed the connection)
23:04:33 <Rembane> That implies some kind of non determinism which I find comforting. :)
23:04:48 coot joins (~coot@2a02:a310:e03f:8500:5cc8:47c:8ec0:b827)
23:05:12 × FirstAsTragedy quits (~philg@220.240.104.208) (Quit: Konversation terminated!)
23:05:12 <EvanR> ah yeah, american Math is something you can't argue with
23:05:29 <EvanR> if you study maths... you have options
23:05:42 × tromp quits (~textual@dhcp-077-249-230-040.chello.nl) (Quit: My iMac has gone to sleep. ZZZzzz…)
23:05:45 <hpc> i prefer computer sciences
23:05:51 <hpc> or if you read smbc, computers science
23:06:11 <EvanR> accounts receivable
23:07:33 <hpc> somewhere in super-america, they study physic instead of physics
23:08:22 <Rembane> The one true physic.
23:09:06 <otherwise> '=D
23:10:00 whatsupdoc joins (uid509081@id-509081.hampstead.irccloud.com)
23:11:55 × kupi quits (uid212005@id-212005.hampstead.irccloud.com) (Quit: Connection closed for inactivity)
23:14:32 × sprout quits (~quassel@2a02:a467:ccd6:1:bc5b:dbe0:79e5:a909) (Ping timeout: 240 seconds)
23:14:35 tomku joins (~tomku@user/tomku)
23:15:17 × jeetelongname quits (~jeet@88-111-159-26.dynamic.dsl.as9105.com) (Ping timeout: 252 seconds)
23:18:50 Feuermagier joins (~Feuermagi@user/feuermagier)
23:19:51 <mjrosenb> after we figure out the GUT, then we will finally have physic.
23:23:40 tromp joins (~textual@dhcp-077-249-230-040.chello.nl)
23:25:10 kaph joins (~kaph@net-2-45-51-147.cust.vodafonedsl.it)
23:25:23 × Feuermagier quits (~Feuermagi@user/feuermagier) (Remote host closed the connection)
23:27:28 Feuermagier joins (~Feuermagi@user/feuermagier)
23:28:13 sprout joins (~quassel@2a02:a467:ccd6:1:c901:71e0:4716:476b)
23:28:32 × evocatus quits (~evocatus@62.182.78.42) (Quit: Leaving)
23:30:04 × lbseale quits (~ep1ctetus@user/ep1ctetus) (Quit: Leaving)
23:30:08 AlexNoo_ joins (~AlexNoo@178.34.160.99)
23:31:17 × coot quits (~coot@2a02:a310:e03f:8500:5cc8:47c:8ec0:b827) (Quit: coot)
23:32:14 × Alex_test quits (~al_test@178.34.150.63) (Ping timeout: 268 seconds)
23:32:51 × AlexZenon quits (~alzenon@178.34.150.63) (Ping timeout: 268 seconds)
23:33:29 × sprout quits (~quassel@2a02:a467:ccd6:1:c901:71e0:4716:476b) (Ping timeout: 268 seconds)
23:34:05 × AlexNoo quits (~AlexNoo@178.34.150.63) (Ping timeout: 268 seconds)
23:34:54 <carbolymer> the physic of the gut
23:35:44 × falafel quits (~falafel@2603-8000-d800-688c-502d-7280-71cc-20e7.res6.spectrum.com) (Remote host closed the connection)
23:35:45 <geekosaur> isn't a physic what you take when your gut hurts?
23:36:05 falafel joins (~falafel@2603-8000-d800-688c-502d-7280-71cc-20e7.res6.spectrum.com)
23:36:56 AlexZenon joins (~alzenon@178.34.160.99)
23:36:56 Alex_test joins (~al_test@178.34.160.99)
23:40:05 <hpc> my gut only hurts if i try to eat a monad too fast
23:40:16 <hpc> i mean, burrito
23:42:53 × Feuermagier quits (~Feuermagi@user/feuermagier) (Remote host closed the connection)
23:43:21 × tromp quits (~textual@dhcp-077-249-230-040.chello.nl) (Quit: My iMac has gone to sleep. ZZZzzz…)
23:43:56 merijn joins (~merijn@83-160-49-249.ip.xs4all.nl)
23:46:25 × aliosablack quits (~chomwitt@ppp-2-85-245-134.home.otenet.gr) (Ping timeout: 268 seconds)
23:47:01 × Jing quits (~hedgehog@2604:a840:3::1061) (Remote host closed the connection)
23:47:02 × chomwitt quits (~chomwitt@ppp-2-85-245-134.home.otenet.gr) (Ping timeout: 268 seconds)
23:47:49 <otherwise> I'm stuck on this "learn you a haskell..." sentence:
23:47:49 <otherwise> "We could have done this pattern matching directly in the function's parameters (it would have been shorter and clearer actually) but this just goes to show that it's possible to do it in where bindings as well."
23:47:50 <otherwise> here is my attempt to do just that (pattern match directly in the functions parameters: https://paste.tomsmeding.com/uIZZTTF8
23:48:04 Jing joins (~hedgehog@2604:a840:3::1061)
23:48:13 <otherwise> Any hints on how I can better approach this?
23:49:47 <monochrom> initials (f:_) (l:_) = [f] ++ ". " ++ [l] ++ "."
23:50:17 × falafel quits (~falafel@2603-8000-d800-688c-502d-7280-71cc-20e7.res6.spectrum.com) (Ping timeout: 240 seconds)
23:50:31 <monochrom> This is what's wrong with writing paragraphs after paragraphs of prose.
23:50:42 <hololeap> initials' firstname lastname = let (f:_) = firstname ; (l:_) = lastname in f ++ "." ++ l ++ "."
23:51:57 <otherwise> well I got it but it kinda felt like a guess...
23:52:22 <otherwise> oh sorry I didnt see your responses till after my second comment
23:53:13 × raehik quits (~raehik@cpc95906-rdng25-2-0-cust156.15-3.cable.virginm.net) (Ping timeout: 250 seconds)
23:53:30 <otherwise> initials' :: String -> String -> String
23:53:31 <otherwise> initials' (f:firstname) (l:lastname) = [f] ++ "." ++ [l] ++ "." --((f:_) = firstname) ++ "." ++ ((l:_) = lastname) ++ "."
23:54:01 <otherwise> just this actually:
23:54:01 <otherwise> initials' (f:firstname) (l:lastname) = [f] ++ "." ++ [l] ++ "."
23:54:16 hololeap forgot to put f and l inside lists
23:55:09 <monochrom> copy-paste-edit is more reliable than writing from scratch :)
23:55:11 <hololeap> since you're not using the firstname or lastname variables there, you can just replacethem with an underscore _
23:55:33 <jollygood2> I'm implementing my own list for fun and practice. should I define any other instance? https://paste.tomsmeding.com/pDJi5AZm
23:55:37 × n3rdy1 quits (~n3rdy1@2601:281:c780:a510:31c5:bd6a:19eb:499b) (Ping timeout: 240 seconds)
23:56:14 <monochrom> Traversable, Alternative, MonadPlus
23:56:14 <hololeap> jollygood2: now it's time to implement Traversable
23:56:17 <geekosaur> ^
23:56:25 <monochrom> IsList >:)
23:57:08 <jollygood2> I did IsList :P. those other 3 sound good
23:57:18 <monochrom> Semigroup. Are you using a relative old GHC? Semigroup is a requirement for Monoid these days.
23:57:19 × max22- quits (~maxime@2a01cb0883359800ba08fcf16942d473.ipv6.abo.wanadoo.fr) (Remote host closed the connection)
23:57:29 <monochrom> Ah I see.
23:57:49 <jollygood2> I'm usin golder version, waiting for bug-free version of 9.2 to upgrade
23:58:03 <geekosaur> how much older isolder?
23:58:33 <jollygood2> 8.8.3 :P
23:58:48 <monochrom> MonadFail :)
23:58:57 <monochrom> Not sure if it's in 8.8
23:59:30 <jollygood2> I did just instance Semigroup (List a) where and it compiled without warnings. there's no need to define anything in newer versions as well?
23:59:55 × Bartol quits (~Bartol@user/Bartol) (Remote host closed the connection)
23:59:55 <monochrom> In newer version, if you don't have Semigroup, you aren't allowed Monoid.

All times are in UTC on 2021-12-23.