Home freenode/#haskell: Logs Calendar

Logs on 2020-12-23 (freenode/#haskell)

00:00:07 <monochrom> Unrelated:
00:00:12 <monochrom> @quote monochrom play
00:00:12 <lambdabot> monochrom says: Hey! If you extend the random monad to playing Poker, do you call the new monad... Pokermon? :)
00:00:20 hexo joins (~hexo@gateway/tor-sasl/hexo)
00:00:21 olligobber joins (olligobber@gateway/vpn/privateinternetaccess/olligobber)
00:00:25 × heatsink quits (~heatsink@2600:1700:bef1:5e10:e906:26f8:b4d1:f41d) (Remote host closed the connection)
00:02:17 × dandart quits (~Thunderbi@2a00:23c7:f5a6:d001:21e9:329e:6e0c:5ce) (Ping timeout: 272 seconds)
00:02:21 jamm joins (~jamm@unaffiliated/jamm)
00:02:25 wroathe joins (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net)
00:04:00 hackage kempe 0.1.1.1 - Kempe compiler https://hackage.haskell.org/package/kempe-0.1.1.1 (vmchale)
00:04:38 heatsink joins (~heatsink@2600:1700:bef1:5e10:e906:26f8:b4d1:f41d)
00:05:33 aveltras joins (uid364989@gateway/web/irccloud.com/x-zzmyqiierndocsik)
00:06:28 ron3 joins (~ron@s91904426.blix.com)
00:06:43 × livvy quits (~livvy@gateway/tor-sasl/livvy) (Ping timeout: 240 seconds)
00:06:51 × jamm quits (~jamm@unaffiliated/jamm) (Ping timeout: 258 seconds)
00:07:25 × wroathe quits (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Ping timeout: 264 seconds)
00:09:36 wonko7 joins (~wonko7@lns-bzn-55-82-255-183-4.adsl.proxad.net)
00:10:09 × danvet quits (~Daniel@2a02:168:57f4:0:efd0:b9e5:5ae6:c2fa) (Ping timeout: 268 seconds)
00:17:01 merijn joins (~merijn@83-160-49-249.ip.xs4all.nl)
00:19:16 sand_dull joins (~theuser@c-73-149-95-105.hsd1.ct.comcast.net)
00:21:19 × gehmehgeh quits (~ircuser1@gateway/tor-sasl/gehmehgeh) (Quit: Leaving)
00:22:05 × merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 240 seconds)
00:23:10 × Vulfe_ quits (~vulfe@2600:1702:31b0:34e0:a017:afb:342e:7f38) (Remote host closed the connection)
00:24:15 × xiinotulp quits (~q@node-uov.pool-125-24.dynamic.totinternet.net) (Quit: Leaving)
00:25:28 × Alleria_ quits (~AllahuAkb@2604:2000:1484:26:158b:2144:660a:a16b) (Ping timeout: 260 seconds)
00:26:39 Sheilong joins (uid293653@gateway/web/irccloud.com/x-rkgukjcpotfcdltb)
00:27:02 Alleria_ joins (~AllahuAkb@69.202.254.168)
00:28:47 Lycurgus joins (~niemand@cpe-45-46-137-210.buffalo.res.rr.com)
00:31:55 × sand_dull quits (~theuser@c-73-149-95-105.hsd1.ct.comcast.net) (Ping timeout: 246 seconds)
00:33:16 jamm joins (~jamm@unaffiliated/jamm)
00:35:25 × Tuplanolla quits (~Tuplanoll@91-159-68-239.elisa-laajakaista.fi) (Ping timeout: 246 seconds)
00:35:55 × alx741 quits (~alx741@186.178.110.239) (Ping timeout: 256 seconds)
00:37:54 × jamm quits (~jamm@unaffiliated/jamm) (Ping timeout: 268 seconds)
00:40:24 × magma quits (~magma@host-79-22-138-220.retail.telecomitalia.it) (Ping timeout: 272 seconds)
00:42:13 × Gurkenglas quits (~Gurkengla@unaffiliated/gurkenglas) (Ping timeout: 264 seconds)
00:42:48 wroathe joins (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net)
00:48:00 × jonkri quits (~jonkri@pontarius/jon) (Quit: leaving)
00:49:02 × machinedgod quits (~machinedg@135-23-192-217.cpe.pppoe.ca) (Remote host closed the connection)
00:49:55 alx741 joins (~alx741@186.178.110.248)
00:50:28 machinedgod joins (~machinedg@135-23-192-217.cpe.pppoe.ca)
00:52:06 merijn joins (~merijn@83-160-49-249.ip.xs4all.nl)
00:54:02 × N3RGY quits (~N3RGY@2600:1700:65aa:90b0:6446:3ba0:c322:ad4c) (Ping timeout: 260 seconds)
00:55:29 abitibien joins (~abitibien@51.194.80.91)
00:57:28 uraniumz joins (x64cmd@gateway/vpn/privateinternetaccess/x64cmd)
00:58:09 × star_cloud quits (~star_clou@ec2-34-220-44-120.us-west-2.compute.amazonaws.com) (Ping timeout: 260 seconds)
01:01:22 × Younder quits (~john@33.51-174-155.customer.lyse.net) (Quit: Leaving)
01:07:25 × wonko7 quits (~wonko7@lns-bzn-55-82-255-183-4.adsl.proxad.net) (Ping timeout: 240 seconds)
01:07:25 kam1 joins (~kam1@24.231.108.143)
01:08:17 × royal_screwup21 quits (52254809@gateway/web/cgi-irc/kiwiirc.com/ip.82.37.72.9) (Quit: Connection closed)
01:08:20 <ezzieyguywuf> lol
01:08:30 <ezzieyguywuf> @ hololeap thanks for helping me look into this
01:08:39 <ezzieyguywuf> I at least have a clue now of how to move forward
01:08:39 royal_screwup21 joins (52254809@gateway/web/cgi-irc/kiwiirc.com/ip.82.37.72.9)
01:08:41 × heatsink quits (~heatsink@2600:1700:bef1:5e10:e906:26f8:b4d1:f41d) (Remote host closed the connection)
01:09:51 fxg joins (~fxg@unaffiliated/fxg)
01:10:16 × fuzzypixelz quits (~fuzzypixe@eth-west-pareq2-46-193-4-100.wb.wifirst.net) (Quit: fuzzypixelz)
01:11:10 Vulfe joins (~vulfe@2600:1702:31b0:34e0:a017:afb:342e:7f38)
01:11:17 × eacameron quits (uid256985@gateway/web/irccloud.com/x-vxdrpcotoqmkhsji) (Quit: Connection closed for inactivity)
01:18:42 × kuribas quits (~user@ptr-25vy0i7ylwdflfexhxz.18120a2.ip6.access.telenet.be) (Quit: ERC (IRC client for Emacs 26.3))
01:24:25 hieung1401 joins (ac6529a5@cpe-172-101-41-165.maine.res.rr.com)
01:25:56 × merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 240 seconds)
01:26:42 dandart joins (~Thunderbi@2a00:23c7:f5a6:d001:21e9:329e:6e0c:5ce)
01:26:50 × benjamingr__ quits (uid23465@gateway/web/irccloud.com/x-ohsvkwapujoenvvu) (Quit: Connection closed for inactivity)
01:27:34 × wroathe quits (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Ping timeout: 246 seconds)
01:28:38 × aplainzetakind quits (~johndoe@captainludd.powered.by.lunarbnc.net) (Quit: Free ZNC ~ Powered by LunarBNC: https://LunarBNC.net)
01:29:06 × Zialus quits (~RMF@2001:818:de63:c300:211:32ff:fe8d:ad2a) (Quit: i'm out!)
01:29:41 × mimi_vx quits (~mimi@2a01:490:16:1026:81e9:63f1:91e1:9716) (Ping timeout: 272 seconds)
01:31:30 Wamanuz2 joins (~wamanuz@78-70-34-81-no84.tbcn.telia.com)
01:33:25 × Wamanuz quits (~wamanuz@90-230-67-56-no84.tbcn.telia.com) (Ping timeout: 240 seconds)
01:33:28 × jedws quits (~jedws@121.209.189.201) (Quit: My MacBook has gone to sleep. ZZZzzz…)
01:34:19 jedws joins (~jedws@121.209.189.201)
01:39:07 × al3x27 quits (~plovs@85.254.75.83) (Ping timeout: 246 seconds)
01:39:30 <ezzieyguywuf> yikes
01:39:32 <ezzieyguywuf> template haskell
01:39:32 <ezzieyguywuf> lol
01:41:16 × kam1 quits (~kam1@24.231.108.143) (Ping timeout: 240 seconds)
01:46:50 × hiroaki quits (~hiroaki@ip4d16fa3b.dynamic.kabel-deutschland.de) (Read error: Connection reset by peer)
01:47:07 × columbarius quits (~columbari@i5E86B3C9.versanet.de) (Read error: Connection reset by peer)
01:48:10 × uraniumz quits (x64cmd@gateway/vpn/privateinternetaccess/x64cmd) (Quit: Leaving)
01:49:02 hieung1401 parts (ac6529a5@cpe-172-101-41-165.maine.res.rr.com) ()
01:49:27 columbarius joins (~columbari@87.123.198.19)
01:50:40 × thc202 quits (~thc202@unaffiliated/thc202) (Ping timeout: 268 seconds)
01:53:57 Lord_of_Life_ joins (~Lord@unaffiliated/lord-of-life/x-0885362)
01:54:49 × Lord_of_Life quits (~Lord@unaffiliated/lord-of-life/x-0885362) (Ping timeout: 264 seconds)
01:55:00 hackage hinit 0.1.0 - Generic project initialization tool https://hackage.haskell.org/package/hinit-0.1.0 (Poscat)
01:55:16 Lord_of_Life_ is now known as Lord_of_Life
01:55:51 mimi_vx joins (~mimi@2a01:490:16:1026:81e9:63f1:91e1:9716)
01:57:00 merijn joins (~merijn@83-160-49-249.ip.xs4all.nl)
01:59:05 × m0rphism quits (~m0rphism@HSI-KBW-085-216-104-059.hsi.kabelbw.de) (Ping timeout: 240 seconds)
01:59:40 roconnor joins (~roconnor@host-45-78-199-13.dyn.295.ca)
02:00:25 kam1 joins (~kam1@24.231.108.143)
02:01:38 wroathe joins (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net)
02:02:33 hiroaki joins (~hiroaki@2a02:810b:c63f:eea0::3)
02:02:37 × merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 264 seconds)
02:02:42 × uwap_ quits (~uwap@genja.uwap.name) (Quit: ZNC 1.8.0 - https://znc.in)
02:05:58 jrc73 joins (6fc8f137@111.200.241.55)
02:06:04 × wroathe quits (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Ping timeout: 246 seconds)
02:06:49 × Entertainment quits (~entertain@104.246.132.210) (Ping timeout: 264 seconds)
02:09:25 heatsink joins (~heatsink@2600:1700:bef1:5e10:e906:26f8:b4d1:f41d)
02:09:49 × kam1 quits (~kam1@24.231.108.143) (Ping timeout: 264 seconds)
02:11:14 × heatsink quits (~heatsink@2600:1700:bef1:5e10:e906:26f8:b4d1:f41d) (Remote host closed the connection)
02:11:23 heatsink joins (~heatsink@2600:1700:bef1:5e10:e906:26f8:b4d1:f41d)
02:11:40 × cr3 quits (~cr3@192-222-143-195.qc.cable.ebox.net) (Ping timeout: 246 seconds)
02:15:33 drbean joins (~drbean@TC210-63-209-216.static.apol.com.tw)
02:16:02 × dandart quits (~Thunderbi@2a00:23c7:f5a6:d001:21e9:329e:6e0c:5ce) (Ping timeout: 260 seconds)
02:17:01 kam1 joins (~kam1@24.231.108.143)
02:18:25 × mounty quits (~mounty@2001:8000:2f59:0:dc99:8f7f:11be:dca1) (Ping timeout: 268 seconds)
02:20:40 × perrier-jouet quits (~perrier-j@modemcable012.251-130-66.mc.videotron.ca) (Quit: WeeChat 2.9)
02:21:37 × borne quits (~fritjof@200116b864c6f800c0a3d285e8e687f4.dip.versatel-1u1.de) (Ping timeout: 272 seconds)
02:22:39 sand_dull joins (~theuser@c-73-149-95-105.hsd1.ct.comcast.net)
02:24:37 × royal_screwup21 quits (52254809@gateway/web/cgi-irc/kiwiirc.com/ip.82.37.72.9) (Quit: Connection closed)
02:24:59 royal_screwup21 joins (52254809@gateway/web/cgi-irc/kiwiirc.com/ip.82.37.72.9)
02:25:23 × jedws quits (~jedws@121.209.189.201) (Quit: My MacBook has gone to sleep. ZZZzzz…)
02:25:24 aplainzetakind joins (~johndoe@captainludd.powered.by.lunarbnc.net)
02:27:39 × drbean quits (~drbean@TC210-63-209-216.static.apol.com.tw) (Quit: ZNC 1.8.2+cygwin1 - https://znc.in)
02:28:42 jrc73 parts (6fc8f137@111.200.241.55) ()
02:29:13 uwap joins (~uwap@genja.uwap.name)
02:30:45 × mimi_vx quits (~mimi@2a01:490:16:1026:81e9:63f1:91e1:9716) (Ping timeout: 268 seconds)
02:33:41 merijn joins (~merijn@83-160-49-249.ip.xs4all.nl)
02:37:51 × xcmw quits (~textual@2603-6011-2200-f103-b803-6e7f-4f6f-d00a.res6.spectrum.com) (Quit: My MacBook has gone to sleep. ZZZzzz…)
02:37:51 rBiosas joins (~biosas@ip-62-24-80-122.net.upcbroadband.cz)
02:43:59 nineonine joins (~nineonine@S01061cabc0b095f3.vf.shawcable.net)
02:44:08 × nineonin_ quits (~nineonine@50.216.62.2) (Ping timeout: 256 seconds)
02:44:21 × rBiosas quits (~biosas@ip-62-24-80-122.net.upcbroadband.cz) (Quit: Konversation terminated!)
02:44:26 × Sheilong quits (uid293653@gateway/web/irccloud.com/x-rkgukjcpotfcdltb) ()
02:45:14 × aveltras quits (uid364989@gateway/web/irccloud.com/x-zzmyqiierndocsik) (Quit: Connection closed for inactivity)
02:45:25 × Lycurgus quits (~niemand@cpe-45-46-137-210.buffalo.res.rr.com) (Quit: Exeunt)
02:45:33 fuzzypixelz joins (~fuzzypixe@eth-west-pareq2-46-193-4-100.wb.wifirst.net)
02:47:55 star_cloud joins (~star_clou@ec2-34-220-44-120.us-west-2.compute.amazonaws.com)
02:48:46 nbloomf joins (~nbloomf@2600:8803:7c88:cb00:b91f:8517:762f:dce7)
02:50:54 <sshine> dminuoso, I glanced at Parsley and see that it defines a Quapplicative. Ó_ò
02:53:46 wroathe joins (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net)
02:54:01 × jmchael quits (~jmchael@81.174.205.210) (Ping timeout: 246 seconds)
02:54:23 N3RGY joins (~N3RGY@2600:1700:65aa:90b0:6446:3ba0:c322:ad4c)
02:57:30 d34df00d joins (~d34df00d@104-14-27-213.lightspeed.austtx.sbcglobal.net)
02:57:34 <d34df00d> Hi!
02:57:41 <sshine> do μ <- askM
02:57:42 <sshine> σ <- freshΣ
02:57:59 <sshine> natural choices for variable names.
02:58:22 <d34df00d> I have a somewhat (computationally) simple pure function returning an Int and I'd like to run it a bunch of times to estimate its performance, summing all the results.
02:58:22 <sshine> hello d34df00d
02:58:27 <MarcelineVQ> sometimes you just want the freshest sigmas in the pantry
02:58:35 × nineonine quits (~nineonine@S01061cabc0b095f3.vf.shawcable.net) (Read error: Connection reset by peer)
02:58:36 nineonin_ joins (~nineonine@S01061cabc0b095f3.vf.shawcable.net)
02:58:41 <d34df00d> How can I do that without the compiler doing any kind of fancy optimizations like calling the function once instead of several times?
02:58:58 <d34df00d> > μ, σ, Σ
02:59:00 <lambdabot> <hint>:1:2: error: <hint>:1:2: error: parse error on input ‘,’
02:59:00 <d34df00d> Is this agda channel?
02:59:27 × N3RGY quits (~N3RGY@2600:1700:65aa:90b0:6446:3ba0:c322:ad4c) (Ping timeout: 260 seconds)
02:59:34 <sshine> d34df00d, well, you can turn off optimizations.
02:59:47 <sshine> d34df00d, you can also run your benchmark with and without optimizations to see if it makes a difference.
02:59:53 <d34df00d> sshine: that kinda ruins the purpose of stupid benchmarks.
03:00:12 <sshine> d34df00d, not if the purpose of your stupid benchmarks is to understand how your code behaves?
03:00:15 × xff0x_ quits (~fox@2001:1a81:53b4:600:a2ff:122b:9237:e1f5) (Ping timeout: 272 seconds)
03:00:48 <d34df00d> Nah, I'm arguing with somebody over the internets, and they claim that C is the fastest language for a certain thing.
03:01:05 <sshine> ah. someone is clearly wrong on the internets. :-D
03:01:17 <d34df00d> Exactly!
03:01:19 <sshine> I think OCaml already beat C in that old language shoutout?
03:01:37 xff0x_ joins (~fox@2001:1a81:53e9:2700:dda4:db:6894:1544)
03:01:53 <sshine> d34df00d, https://chrispenner.ca/posts/wc
03:02:22 <MarcelineVQ> languages don't have a speed :X
03:02:43 <d34df00d> sshine: funnily, I did play around with that implementation some time ago.
03:02:48 <d34df00d> https://0xd34df00d.me/posts/2020/02/beating-c-with-20-lines-of-haskell.html
03:03:07 <sshine> d34df00d, haha.
03:03:11 <d34df00d> Well, dunno how February 02 is "recent", I have completely lost the sense of time.
03:03:32 <sshine> time no longre exists. we are inside a fractal.
03:03:42 <MarcelineVQ> all times are recent if you're over 30
03:03:53 <d34df00d> I'll be 30 in a couple of months, so dunno.
03:03:58 <MarcelineVQ> there you go
03:04:01 <sshine> https://xkcd.com/891/ obligatory
03:04:24 <sshine> although this one is outdated, the 2011 title alone makes me feel old.
03:05:06 <d34df00d> Dang, my haskell implementation got faster than C.
03:05:14 <d34df00d> I mean, in my today's case.
03:05:50 <sshine> d34df00d, I think if you run criterion on your function, it won't cache anything unless you specifically try to.
03:06:59 <d34df00d> I mean, some guy gave me a C version of an algorithm to implement (roughly speaking), including a main() consisting of `volatile int sum = 0; for (int i = 0; i < 999999; ++i) sum += ...`, and I"m trying to get something getting that very job with a minimal amount of stuff on top.
03:07:10 <d34df00d> But maybe I'll just go ahead and use criterion, yes.
03:08:01 × merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 264 seconds)
03:08:16 <sshine> maybe that is a geometric series with a closed form? :-P
03:08:45 × nineonin_ quits (~nineonine@S01061cabc0b095f3.vf.shawcable.net) (Ping timeout: 240 seconds)
03:09:13 nineonine joins (~nineonine@S01061cabc0b095f3.vf.shawcable.net)
03:09:23 <MarcelineVQ> sshine: lel
03:09:28 jedws joins (~jedws@121.209.189.201)
03:09:38 × sdrodge_ quits (~sdrodge@unaffiliated/sdrodge) (Quit: WeeChat 2.9)
03:10:19 <d34df00d> Lol, unlikely.
03:10:41 <MarcelineVQ> % foldl1' (+) [0 .. 999998]
03:10:41 <yahb> MarcelineVQ: 499998500001
03:10:46 sdrodge joins (~sdrodge@unaffiliated/sdrodge)
03:11:00 <MarcelineVQ> oh ++i
03:11:02 <MarcelineVQ> damn you c!
03:13:25 × kam1 quits (~kam1@24.231.108.143) (Ping timeout: 240 seconds)
03:13:25 × theDon quits (~td@muedsl-82-207-238-252.citykom.de) (Ping timeout: 264 seconds)
03:13:52 N3RGY joins (~N3RGY@2600:1700:65aa:90b0:6446:3ba0:c322:ad4c)
03:14:05 × jespada quits (~jespada@90.254.245.49) (Ping timeout: 240 seconds)
03:14:22 <d34df00d> Ok, I must have made a mistake somewhere.
03:14:31 <d34df00d> My haskell version is about 20 times faster than C.
03:14:41 <d34df00d> https://bpaste.net/4C5Q
03:14:49 <d34df00d> ^ here's my implementation. Do you folks spot any obvious nonsense?
03:15:05 theDon joins (~td@muedsl-82-207-238-067.citykom.de)
03:15:54 hexfive joins (~hexfive@50-47-142-195.evrt.wa.frontiernet.net)
03:16:37 jespada joins (~jespada@90.254.245.49)
03:17:38 <sshine> d34df00d, won't 'all' be faster than 'and . zipWith f'?
03:17:59 <sshine> maybe not. sounds like you've got it pretty tweaked already.
03:18:35 lagothrix is now known as Guest36126
03:18:35 xirhtogal joins (~lagothrix@unaffiliated/lagothrix)
03:18:35 × Guest36126 quits (~lagothrix@unaffiliated/lagothrix) (Killed (hitchcock.freenode.net (Nickname regained by services)))
03:18:35 xirhtogal is now known as lagothrix
03:18:39 × royal_screwup21 quits (52254809@gateway/web/cgi-irc/kiwiirc.com/ip.82.37.72.9) (Quit: Connection closed)
03:18:51 × N3RGY quits (~N3RGY@2600:1700:65aa:90b0:6446:3ba0:c322:ad4c) (Ping timeout: 268 seconds)
03:19:02 royal_screwup21 joins (52254809@gateway/web/cgi-irc/kiwiirc.com/ip.82.37.72.9)
03:19:32 <sshine> wait, never mind.
03:21:53 <MarcelineVQ> could check your core for countAllMatches being lifted to the top level, there's no need to compute it more than once in this program so maybe it's not
03:22:21 <MarcelineVQ> could also try countAllMatches :: () -> ST s Int cnt <- countAllMatches ()
03:23:36 <MarcelineVQ> since functions aren't shared in this way afaik
03:23:48 × royal_screwup21 quits (52254809@gateway/web/cgi-irc/kiwiirc.com/ip.82.37.72.9) (Ping timeout: 256 seconds)
03:25:15 kam1 joins (~kam1@24.231.108.143)
03:25:21 × bitmapper quits (uid464869@gateway/web/irccloud.com/x-icrmchothviupllr) (Quit: Connection closed for inactivity)
03:27:15 <jle`> whoa, the StateT-backed version of WriterT is in transformers
03:27:17 <jle`> when did this happen
03:27:30 <MarcelineVQ> iiuc countAllMatches is a name, which means it can be shared (computed at most once on average). In the same way that x is a name and can be shared in let x = 2 + 1 in x + x
03:28:30 <jle`> the main reason i avoided WriterT is now gone
03:28:47 <MarcelineVQ> jle`: I challenge you to use it this advent season
03:28:57 Fractalis joins (~Fractalis@2601:987:280:8d40:45d0:942f:6e60:692f)
03:29:17 <jle`> actually i was looking for it to refactor one of my solutions heh
03:32:33 × Vulfe quits (~vulfe@2600:1702:31b0:34e0:a017:afb:342e:7f38) (Remote host closed the connection)
03:33:06 × howdoi quits (uid224@gateway/web/irccloud.com/x-sxhozuhwqoyrdzui) (Quit: Connection closed for inactivity)
03:35:06 Vulfe joins (~vulfe@2600:1702:31b0:34e0:a017:afb:342e:7f38)
03:35:45 cr3 joins (~cr3@192-222-143-195.qc.cable.ebox.net)
03:35:48 × Vulfe quits (~vulfe@2600:1702:31b0:34e0:a017:afb:342e:7f38) (Remote host closed the connection)
03:36:00 × cr3 quits (~cr3@192-222-143-195.qc.cable.ebox.net) (Client Quit)
03:39:04 × urodna quits (~urodna@unaffiliated/urodna) (Quit: urodna)
03:39:11 vikfret joins (~vikfret@2806:2f0:90e1:6afe:d1fc:fdcb:aaa3:aab6)
03:41:56 merijn joins (~merijn@83-160-49-249.ip.xs4all.nl)
03:43:28 royal_screwup21 joins (52254809@gateway/web/cgi-irc/kiwiirc.com/ip.82.37.72.9)
03:43:41 <d34df00d> sshine: yea, I don't think it could be nicely expressed with `all`
03:45:07 <d34df00d> MarcelineVQ: looks like it isn't at the top even without () argument. Anyway, wouldn't it living in the ST monad prevent floating anyway?
03:45:13 <ezzieyguywuf> I don't know anything at all about elm, but these error messages seem nice af https://elm-lang.org/news/the-syntax-cliff
03:45:56 Vulfe joins (~vulfe@2600:1702:31b0:34e0:a017:afb:342e:7f38)
03:46:34 <sshine> ezzieyguywuf, I know few things about Elm, but I know that their error messages are excellent. :) they even try to suggest what you did wrong sometimes, because the syntax is simple enough to make such assumptions.
03:46:56 × merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 240 seconds)
03:47:12 n1n3fly joins (n1n3fly@gateway/vpn/protonvpn/n1n3fly)
03:48:12 <ezzieyguywuf> sshine: yes indeed!
03:48:25 <ezzieyguywuf> this very fact alone makes me much more likely to give it a whirl (one day...)
03:49:55 <MarcelineVQ> d34df00d: I'm sad to say I don't know, or more specifically (since it's already at the top and so doens't need to float) I'm say to say I'm not sure if it's shared or not
03:50:10 <sshine> ezzieyguywuf, yes. I remember a student worker at my old job was really into Haskell and Elm. he did his programming test for getting employed in Elm, and he ran into some problems with 'Set (Set a)' not being representable because you can't make your own data type instances of 'Ord' (because the equivalent of 'Ord' is a magic type variable, kinda like Standard ML's ''a polymorphic equality type, but
03:50:16 <sshine> worse). in spite of these warts, he really liked it because the restriction meant he could be really productive as long as he didn't try to be too smart. :)
03:50:40 <MarcelineVQ> Especially dunno how the presence of the 's' variable affects that
03:50:42 <sshine> ezzieyguywuf, I'd like type classes. that's it. I think.
03:50:55 × Vulfe quits (~vulfe@2600:1702:31b0:34e0:a017:afb:342e:7f38) (Ping timeout: 272 seconds)
03:51:14 <sshine> ezzieyguywuf, maybe I don't even need custom type classes, I just want to be able to define instances for existing ones!
03:52:56 <d34df00d> MarcelineVQ: just to be clear, -ddump-simpl is the right one to get the final output of the simplifier?
03:53:48 <d34df00d> Crap, it floated, I think.
03:54:22 <MarcelineVQ> d34df00d: simpl or prep ye
03:55:00 hackage arch-hs 0.6.0.0 - Distribute hackage packages to archlinux https://hackage.haskell.org/package/arch-hs-0.6.0.0 (berberman)
03:55:05 <d34df00d> So my loop in main pattern-matches (in Core) on something called Main.countAllMatches2, and that one is defined as this::
03:55:13 <ezzieyguywuf> sshine: I think there's a language extension for that in haskell, no?
03:55:14 <d34df00d> https://bpaste.net/JU6A
03:55:18 <d34df00d> That's gonna be memoized, right?
03:55:18 <ezzieyguywuf> FlexibleTypes or summat?
03:55:52 <glguy> GHC doesn't generally memoize anything
03:56:16 <dsal> jle`: What's the use case you have for WriterT? It's never seemed like a useful thing to me.
03:56:16 guest1222 joins (~user@49.5.6.87)
03:56:26 <dsal> "logging" or whatever.
03:56:56 <sshine> ezzieyguywuf, FlexibleContexts or FlexibleInstances? what do you mean?
03:57:10 <d34df00d> glguy: I mean, is that equivalent to a top-level value of type `Int`, that will surely be memoized?
03:57:13 <sshine> ezzieyguywuf, Haskell lets you define your own type classes without extensions? :)
03:57:40 <jle`> dsal: just accumulate a monoid. a lot of times i'd like to use it over Endo
03:57:47 <jle`> or use Sum to count how many times
03:58:03 <ezzieyguywuf> oh maybe I was just confused.
03:58:20 <sshine> that happens to me once a minute.
03:58:23 <dsal> Hmm... I guess I could see that. I'd pretty much always go State first and then decide I'm not reading anything.
03:58:31 <dsal> I don't think in terms of State much either, though.
04:00:20 × n1n3fly quits (n1n3fly@gateway/vpn/protonvpn/n1n3fly) (Quit: Leaving)
04:00:33 × guest1222 quits (~user@49.5.6.87) (Remote host closed the connection)
04:00:41 × notzmv quits (~user@unaffiliated/zmv) (Remote host closed the connection)
04:00:42 guest1222 joins (~user@49.5.6.87)
04:01:10 <monochrom> d34df00d: simpl is at the best level of abstraction and details for humans. But I have seen one or two rare cases of infelicity in simpl, in terms of what becomes a thunk vs what becomes evaluated right away. prep is official on this, but usually too tedious for humans. I always ask for all 4 of simpl, prep, opt-cmm, and asm at the same time. Sometimes also stg.
04:01:20 <sshine> I often build interpreters for small things, and I really like State/StateT there.
04:02:20 × Wuzzy quits (~Wuzzy@p549c9519.dip0.t-ipconnect.de) (Remote host closed the connection)
04:02:39 × Mikagami quits (~MOSCOS@122.54.107.175) (Remote host closed the connection)
04:02:50 <dsal> Yeah, I should get more practice doing neat things rather than being all boring with these. I like reading jle`s writeups from AoC. Every once in a while, I learn something useful that I'm willing to apply.
04:03:06 <dsal> jle`: TBH, I wouldn't ever reach for Endo, either. Do you have an example/
04:03:06 Mikagami joins (~MOSCOS@122.54.107.175)
04:04:50 <sshine> dsal, yeah, especially related to Free. :)
04:05:34 <glguy> d34df00d, Oh, a top-level Main.countAllMatches2 :: Int would generally only be computed once, if that's the question
04:06:38 <glguy> dsal, writer is good for lazy streaming situations, generally
04:07:47 mimi_vx joins (~mimi@2a01:490:16:1026:81e9:63f1:91e1:9716)
04:07:55 <dsal> hmm... That's interesting. I need to make more exercises for myself to solve problems in different ways. We've had a couple good problems this year I could do that with.
04:08:01 × sand_dull quits (~theuser@c-73-149-95-105.hsd1.ct.comcast.net) (Ping timeout: 264 seconds)
04:08:29 <glguy> but you have to be very careful when doing that that you don't inadvertently create a data dependency that would defeat that laziness
04:10:16 × ddellacosta quits (dd@gateway/vpn/mullvad/ddellacosta) (Ping timeout: 256 seconds)
04:11:02 × Fractalis quits (~Fractalis@2601:987:280:8d40:45d0:942f:6e60:692f) (Ping timeout: 258 seconds)
04:11:11 × royal_screwup21 quits (52254809@gateway/web/cgi-irc/kiwiirc.com/ip.82.37.72.9) (Quit: Connection closed)
04:11:32 royal_screwup21 joins (52254809@gateway/web/cgi-irc/kiwiirc.com/ip.82.37.72.9)
04:13:15 Vulfe joins (~vulfe@2600:1702:31b0:34e0:a017:afb:342e:7f38)
04:13:23 × nbloomf quits (~nbloomf@2600:8803:7c88:cb00:b91f:8517:762f:dce7) (Quit: My MacBook has gone to sleep. ZZZzzz…)
04:13:45 × fxg quits (~fxg@unaffiliated/fxg) (Ping timeout: 265 seconds)
04:14:07 <glguy> dsal, In 2016 advent of code had 3 related problems built around a common assembly language extended in a couple of ways
04:14:29 <dsal> I've not done any of 2016
04:14:36 <jle`> dsal: this blog post was nice i think
04:14:38 <jle`> https://ocharles.org.uk/blog/posts/2013-02-12-quick-dsls-with-endo-writers.html
04:15:15 <dsal> glguy: your lazy intcode stuff was magic. My approach was not lazy. I don't quite "embrace" laziness as much as appreciate it.
04:15:30 <glguy> I did a merged implementation of the 3 where you could incrementally add instructions to the machine that could be interpreted in multiple ways: https://github.com/glguy/advent2016/blob/master/asmprog-final/Main.hs
04:15:57 <glguy> like this machine had an "out" instruction that emitted a value. I could run it with a Writer (Endo [Int]) in order to produce a lazy list of outputs
04:16:11 <glguy> or with a strict mode that counted the outputs and ran until completion
04:16:34 <hololeap> how would one go about debugging the decrypted https traffic being sent by some TemplateHaskell shenanigans?
04:16:35 <glguy> with the Writer behavior the program would only evaluate long enough to produce the 50 outputs I wanted to look at
04:16:49 × royal_screwup21 quits (52254809@gateway/web/cgi-irc/kiwiirc.com/ip.82.37.72.9) (Ping timeout: 268 seconds)
04:17:21 <ezzieyguywuf> does anyone know if the hlint guy hangs around here? https://github.com/ndmitchell/hlint
04:17:32 <dsal> glguy: Cool, thanks for the poiners.
04:17:34 <hololeap> elm-compiler makes an https connection, and i want to see what it's sending/receiving
04:17:48 <ezzieyguywuf> trying to get some traction on this: https://github.com/ndmitchell/hlint
04:17:55 <ezzieyguywuf> whoops, https://github.com/ndmitchell/hlint/issues/1185
04:17:56 × Vulfe quits (~vulfe@2600:1702:31b0:34e0:a017:afb:342e:7f38) (Ping timeout: 258 seconds)
04:18:09 <ezzieyguywuf> hololeap: https://github.com/elm/compiler/issues/2160
04:19:05 <ezzieyguywuf> hololeap: also, I've posted some of my findings here https://github.com/gentoo-haskell/gentoo-haskell/issues/618
04:19:11 Vulfe joins (~vulfe@2600:1702:31b0:34e0:a017:afb:342e:7f38)
04:19:13 <ezzieyguywuf> 😯
04:19:16 <hololeap> ezzieyguywuf: glad you filed a bug report, but i also want to know how to go about doing this
04:19:17 <ezzieyguywuf> I'm like the link king today
04:19:34 <ezzieyguywuf> hololeap: sure, just wanted to give you the info in case it is useful.
04:19:39 wei2912 joins (~wei2912@unaffiliated/wei2912)
04:19:40 <sshine> Gen.subtermM contractGen (\contract -> Scale <$> scaleGen <*> pure contract) -- can this be more nicely written?
04:21:56 merijn joins (~merijn@83-160-49-249.ip.xs4all.nl)
04:21:59 <sshine> I've got another simpler one that just is: Gen.subterm2 contractGen contractGen Both -- works nicely because it only contains recursive parameters, whereas the other one has 'scaleGen', too.
04:22:20 <sshine> (This is Hedgehog.Gen.)
04:22:32 <MarcelineVQ> liftA2 Scale scaleGen . pure meb, idk if nicer
04:23:57 <MarcelineVQ> erm, I'm not sure what I was thinking there :>
04:24:46 <MarcelineVQ> is that the right translation for liftA2..
04:25:24 <sshine> maybe something like (Scale <$> scaleGen) <*> Gen.subterm... meh. I'll think of it. I think that the first one was easy to write, so it is probably easy to comprehend for that reason. :)
04:26:18 <sshine> sometimes I end up with stuff that contains '(f .)' and 'fmap .' and I know I overdid it.
04:26:51 <sshine> sometimes, though, a simplification gives way to clearer thinking.
04:31:03 × jfalcon quits (905c1fea@144.92.31.234) (Remote host closed the connection)
04:33:30 × Deide quits (~Deide@217.155.19.23) (Quit: Seeee yaaaa)
04:34:20 Codaraxis joins (Codaraxis@gateway/vpn/mullvad/codaraxis)
04:42:13 × mimi_vx quits (~mimi@2a01:490:16:1026:81e9:63f1:91e1:9716) (Ping timeout: 272 seconds)
04:43:54 royal_screwup21 joins (52254809@gateway/web/cgi-irc/kiwiirc.com/ip.82.37.72.9)
04:45:05 × fuzzypixelz quits (~fuzzypixe@eth-west-pareq2-46-193-4-100.wb.wifirst.net) (Ping timeout: 240 seconds)
04:49:18 × royal_screwup21 quits (52254809@gateway/web/cgi-irc/kiwiirc.com/ip.82.37.72.9) (Ping timeout: 272 seconds)
04:51:26 × Vulfe quits (~vulfe@2600:1702:31b0:34e0:a017:afb:342e:7f38) (Remote host closed the connection)
04:51:45 sand_dull joins (~theuser@c-73-149-95-105.hsd1.ct.comcast.net)
04:55:40 Fractalis joins (~Fractalis@2601:987:280:8d40:45d0:942f:6e60:692f)
04:56:18 toorevitimirp joins (~tooreviti@117.182.182.252)
04:56:37 × merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 264 seconds)
05:01:12 Vulfe joins (~vulfe@2600:1702:31b0:34e0:a017:afb:342e:7f38)
05:01:49 Stanley00 joins (~stanley00@unaffiliated/stanley00)
05:06:09 × Vulfe quits (~vulfe@2600:1702:31b0:34e0:a017:afb:342e:7f38) (Ping timeout: 268 seconds)
05:10:42 × Fractalis quits (~Fractalis@2601:987:280:8d40:45d0:942f:6e60:692f) (Ping timeout: 260 seconds)
05:11:14 <iqubic> So, I a parsec question. Let's say I have a string like "41352" and I want to parse it into a [Int]. How do I do that?
05:12:01 Vulfe joins (~vulfe@2600:1702:31b0:34e0:a017:afb:342e:7f38)
05:17:03 × Vulfe quits (~vulfe@2600:1702:31b0:34e0:a017:afb:342e:7f38) (Ping timeout: 272 seconds)
05:18:54 × Tario quits (~Tario@201.192.165.173) (Ping timeout: 260 seconds)
05:19:50 royal_screwup21 joins (52254809@gateway/web/cgi-irc/kiwiirc.com/ip.82.37.72.9)
05:23:24 merijn joins (~merijn@83-160-49-249.ip.xs4all.nl)
05:24:19 × zv quits (~zv@unaffiliated/zv) (Ping timeout: 265 seconds)
05:24:31 × royal_screwup21 quits (52254809@gateway/web/cgi-irc/kiwiirc.com/ip.82.37.72.9) (Ping timeout: 246 seconds)
05:24:33 <hololeap> map read <$> many digit :: ParsecT s u m [Int]
05:26:55 al3x27 joins (~plovs@85.254.75.199)
05:28:28 × merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 256 seconds)
05:28:41 <topos> > digits = some $ do d <- digit; return (digitToInt d); parse digits "" "43256"
05:28:44 <lambdabot> <hint>:1:8: error: <hint>:1:8: error: parse error on input ‘=’
05:28:53 <topos> you get the idea
05:29:16 <topos> > let digits = some $ do d <- digit; return (digitToInt d) in parse digits "" "43256"
05:29:18 <lambdabot> error: Variable not in scope: digit :: f Charerror:
05:29:18 <lambdabot> Variable not in scope: parse :: f0 [Int] -> [Char] -> [Char] -> t
05:29:26 <topos> \o/
05:29:36 <topos> П> parse digits "" "43525"
05:29:37 <topos> Right [4,3,5,2,5]
05:31:09 jamm joins (~jamm@unaffiliated/jamm)
05:32:11 Vulfe joins (~vulfe@2600:1702:31b0:34e0:a017:afb:342e:7f38)
05:32:39 × nurupo quits (~nurupo.ga@unaffiliated/nurupo) (Quit: nurupo.ga)
05:33:42 × jedws quits (~jedws@121.209.189.201) (Quit: My MacBook has gone to sleep. ZZZzzz…)
05:33:46 × wroathe quits (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Quit: leaving)
05:35:45 × jamm quits (~jamm@unaffiliated/jamm) (Ping timeout: 268 seconds)
05:36:38 × Vulfe quits (~vulfe@2600:1702:31b0:34e0:a017:afb:342e:7f38) (Ping timeout: 264 seconds)
05:36:52 jedws joins (~jedws@121.209.189.201)
05:41:45 howdoi joins (uid224@gateway/web/irccloud.com/x-rqnxrwxnhxikpetx)
05:44:01 × Merfont quits (~Kaiepi@47.54.252.148) (Remote host closed the connection)
05:44:02 Kaeipi joins (~Kaiepi@47.54.252.148)
05:50:43 × Kaeipi quits (~Kaiepi@47.54.252.148) (Remote host closed the connection)
05:50:55 Kaeipi joins (~Kaiepi@47.54.252.148)
05:54:41 merijn joins (~merijn@83-160-49-249.ip.xs4all.nl)
05:59:03 mimi_vx joins (~mimi@2a01:490:16:1026:81e9:63f1:91e1:9716)
06:16:38 sord937 joins (~sord937@gateway/tor-sasl/sord937)
06:17:50 × Kaeipi quits (~Kaiepi@47.54.252.148) (Remote host closed the connection)
06:19:16 × olligobber quits (olligobber@gateway/vpn/privateinternetaccess/olligobber) (Ping timeout: 240 seconds)
06:20:42 Kaeipi joins (~Kaiepi@47.54.252.148)
06:20:43 Merfont joins (~Kaiepi@47.54.252.148)
06:20:54 × Kaeipi quits (~Kaiepi@47.54.252.148) (Remote host closed the connection)
06:23:05 × Merfont quits (~Kaiepi@47.54.252.148) (Remote host closed the connection)
06:25:00 × jedws quits (~jedws@121.209.189.201) (Quit: My MacBook has gone to sleep. ZZZzzz…)
06:25:24 Kaiepi joins (~Kaiepi@47.54.252.148)
06:29:01 × merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 264 seconds)
06:31:58 olligobber joins (~olligobbe@unaffiliated/olligobber)
06:33:38 × mimi_vx quits (~mimi@2a01:490:16:1026:81e9:63f1:91e1:9716) (Ping timeout: 258 seconds)
06:41:01 bitmagie joins (~Thunderbi@200116b806efa400c8baafc3789c3ca0.dip.versatel-1u1.de)
06:42:03 × bitmagie quits (~Thunderbi@200116b806efa400c8baafc3789c3ca0.dip.versatel-1u1.de) (Client Quit)
06:44:09 Genius123 joins (~jessiesgi@S01069050ca4e3573.cg.shawcable.net)
06:44:55 × Kaiepi quits (~Kaiepi@47.54.252.148) (Remote host closed the connection)
06:45:10 Kaiepi joins (~Kaiepi@47.54.252.148)
06:45:21 mimi_vx joins (~mimi@2a01:490:16:1026:81e9:63f1:91e1:9716)
06:46:12 <Genius123> question: whats the next abstraction after software? For example atoms can be organized into electronic components which can be organized into circuits/hardware but software (types, functions) can only ever be reorganized into other software (by defining functors and categories instead of types)
06:46:28 <Genius123> so whats "beyond" software? are we just too dumb to see the next level up?
06:49:42 vsiddharth joins (~user@c-73-15-251-38.hsd1.ca.comcast.net)
06:50:15 thc202 joins (~thc202@unaffiliated/thc202)
06:50:36 <pjb> Genius123: basically what we already have biologically: life, including intelligent life.
06:51:20 <pjb> (self-organizing, self-conscious).
06:51:41 <int-e> software is heavily multi-leveled itself and growing a new level every decade or so
06:52:06 <Genius123> is that a "moores" law of software
06:52:20 <Genius123> pjb, yes i thought so
06:52:26 <int-e> did you talk about virtual machine orchestration in 2010?
06:52:27 <Genius123> but still whats after that? God?
06:52:36 <Genius123> theres no limit in theory
06:54:04 <Genius123> int-e, me? no but I never thought about virtualization hm
06:54:36 <Genius123> i guess that is another abstraction of software in a way
06:54:54 <Genius123> but still technically software
06:55:04 <int-e> Genius123: What I'm trying to say is that it's well possible that "software" as a term will just grow to encompass anything replicable and remotely related to computers.
06:55:13 × xff0x_ quits (~fox@2001:1a81:53e9:2700:dda4:db:6894:1544) (Ping timeout: 272 seconds)
06:55:48 xff0x_ joins (~fox@2001:1a81:53e9:2700:db3b:366e:c891:aec7)
06:56:10 <int-e> Instead of there being a new level that is perceived as a distinct enough leap forward to get a different name attached.
06:56:27 nurupo joins (~nurupo.ga@unaffiliated/nurupo)
06:56:35 <pjb> basically, in this universe, we have matter energy and information. They're equivalent. E=mc², and E=hf
06:58:10 <hololeap> bartosz milewski posits that mathematics is the highest abstraction we have, which programming languages are slowly trying to reach. i think he has a good point
06:58:14 <Genius123> what if the "next level" is matter
06:58:27 <pjb> Information is emergent in the mathematical universe, like energy emerges in the physical universe from fluctuations of the vacuum. If you're asking for a higher level concept that would motivate the emergence of information, I'd say it's love.
06:58:31 <Genius123> like you write a program thats so abstract when you look at it, you cant tell difference between it and a real thing
06:58:44 <Genius123> youve written a physical thing into existence
06:58:55 merijn joins (~merijn@83-160-49-249.ip.xs4all.nl)
06:58:56 <hololeap> Genius123: computers _are_ physical so you already have
06:59:19 <Genius123> true
06:59:25 <pjb> Lambda calculus and Turing Machines are not physical.
06:59:27 <Genius123> maybe ive been looking at it in reverse
06:59:40 <Genius123> and the computer is actually the abstraction not software
07:00:18 <hololeap> i guess if you start with programming, the physical computer would be the abstraction
07:00:47 <hololeap> i suppose abstractions could have "duals"
07:04:02 <Genius123> <hololeap> i guess if you start with programming, the physical computer would be the abstraction
07:04:05 <Genius123> mind = blown
07:04:22 <Genius123> begs the question though then if the brain is the computer (abstraction)
07:04:25 × merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 264 seconds)
07:04:37 <Genius123> what was the lower abstraction it emerged from (the dual)
07:04:45 hololeap isn't touching that one
07:04:46 <Genius123> what is dual of mind
07:08:28 danvet joins (~Daniel@2a02:168:57f4:0:efd0:b9e5:5ae6:c2fa)
07:09:31 × Rudd0 quits (~Rudd0@185.189.115.103) (Ping timeout: 246 seconds)
07:09:40 <MarcelineVQ> the gestalt my dude
07:10:17 <hololeap> you could look at all of biology as a sort of computer, but i'm not convinced the mind springs solely from biology
07:10:29 hololeap hides
07:11:08 <MarcelineVQ> watch out, someone will wask you to define what mind means
07:11:37 × sand_dull quits (~theuser@c-73-149-95-105.hsd1.ct.comcast.net) (Ping timeout: 264 seconds)
07:12:24 hololeap stays hidden
07:14:24 <Genius123> mind is just self organizing matter
07:14:37 <Genius123> self organizing computer
07:14:53 <Genius123> one that isnt so rigid as a von neumann type computer
07:15:02 <Genius123> but has "plasticity"
07:15:15 <Genius123> ok i guess thats the "dual" of mind, brain
07:15:19 <Genius123> but they arent same
07:15:24 <Genius123> thatd be like saying software is same as hardware
07:16:00 <Genius123> so mind must exists independently
07:16:33 <Genius123> if they are "duals"
07:17:25 <Genius123> which still begs question wtf is it?
07:17:37 <hololeap> you would have to define what the "compiler" is
07:17:56 takuan joins (~takuan@178-116-218-225.access.telenet.be)
07:18:37 × Feuermagier quits (~Feuermagi@213.178.26.41) (Read error: Connection reset by peer)
07:20:41 royal_screwup21 joins (52254809@gateway/web/cgi-irc/kiwiirc.com/ip.82.37.72.9)
07:24:21 × tzlil quits (~tzlil@unaffiliated/tzlil) (Ping timeout: 272 seconds)
07:25:05 <Genius123> nature
07:25:07 <Genius123> the 'god process'
07:25:32 <Genius123> ok im done this is getting too deep
07:25:32 tzlil joins (~tzlil@unaffiliated/tzlil)
07:25:44 × royal_screwup21 quits (52254809@gateway/web/cgi-irc/kiwiirc.com/ip.82.37.72.9) (Ping timeout: 272 seconds)
07:26:36 × jespada quits (~jespada@90.254.245.49) (Ping timeout: 240 seconds)
07:26:39 <hololeap> yeah, good luck defining the thing you inhabit every moment you are conscious
07:27:01 ActinalWhomp joins (ad49c9f8@pool-173-73-201-248.washdc.fios.verizon.net)
07:27:15 <hololeap> but... science...
07:28:05 <hololeap> the very thing that makes defining something possible. it's all. so. meta.
07:28:25 jespada joins (~jespada@90.254.245.49)
07:29:25 qwerty joins (~tema@217.118.92.215)
07:31:28 merijn joins (~merijn@83-160-49-249.ip.xs4all.nl)
07:34:32 zaquest joins (~notzaques@5.128.210.178)
07:36:28 mputz joins (~Thunderbi@dslb-088-064-063-125.088.064.pools.vodafone-ip.de)
07:37:41 ADG1089__ joins (~aditya@223.235.77.1)
07:42:13 <sshine> I wonder if prettyprinter-1.7.0 will be made available on Stackage.
07:43:10 Vulfe joins (~vulfe@2600:1702:31b0:34e0:a017:afb:342e:7f38)
07:46:50 × danvet quits (~Daniel@2a02:168:57f4:0:efd0:b9e5:5ae6:c2fa) (Ping timeout: 264 seconds)
07:49:10 × petersen quits (~petersen@redhat/juhp) (Ping timeout: 272 seconds)
07:49:57 × Vulfe quits (~vulfe@2600:1702:31b0:34e0:a017:afb:342e:7f38) (Ping timeout: 260 seconds)
07:51:54 vilpan joins (~0@212.117.1.172)
07:56:24 <iqubic> How do I print the contents of an IOUArray?
07:57:35 × pjb quits (~t@2a01cb04063ec500c04af862aff5caa7.ipv6.abo.wanadoo.fr) (Ping timeout: 258 seconds)
08:00:40 × proteusguy quits (~proteusgu@cm-58-10-154-202.revip7.asianet.co.th) (Ping timeout: 268 seconds)
08:02:18 _ht joins (~quassel@82-169-194-8.biz.kpn.net)
08:03:22 <int-e> iqubic: unsafeFreeze and print?
08:03:49 <iqubic> Even better: "getAssocs arr >>= print"
08:03:55 <int-e> Oh.
08:04:38 <int-e> what else have I missed in MArray, hmm
08:05:36 Vulfe joins (~vulfe@2600:1702:31b0:34e0:a017:afb:342e:7f38)
08:05:47 × nhs quits (~nhs@c-67-180-177-103.hsd1.ca.comcast.net) (Read error: Connection reset by peer)
08:05:55 <int-e> Oh well, not much.
08:05:55 × sakirious quits (~sakirious@c-71-197-191-137.hsd1.wa.comcast.net) (Quit: Ping timeout (120 seconds))
08:06:02 nhs joins (~nhs@c-67-180-177-103.hsd1.ca.comcast.net)
08:06:13 sakirious joins (~sakirious@c-71-197-191-137.hsd1.wa.comcast.net)
08:06:59 cfricke joins (~cfricke@unaffiliated/cfricke)
08:08:30 × ADG1089__ quits (~aditya@223.235.77.1) (Remote host closed the connection)
08:10:07 × Vulfe quits (~vulfe@2600:1702:31b0:34e0:a017:afb:342e:7f38) (Ping timeout: 260 seconds)
08:11:50 jpcooper joins (~user@unaffiliated/jpcooper)
08:13:34 proteusguy joins (~proteusgu@cm-58-10-154-202.revip7.asianet.co.th)
08:14:10 asheshambasta joins (~user@ptr-e1lysaxt4bg7tmaahx1.18120a2.ip6.access.telenet.be)
08:14:13 <jpcooper> Hello. Could anyone explain why I'm getting a "Number of parameters must match family declaration; expected 1" when defining an associated type at https://gist.github.com/jpcooper/6ba52c5bc1fbd79bc7adef6720851109? As far as I understand from the GMap examples at https://downloads.haskell.org/~ghc/7.6.3/docs/html/users_guide/type-families.html, this should be possible
08:17:58 <sMuNiX> jpcooper: try, type T Int = m Int instead?
08:18:22 <int-e> or T m = m Int
08:18:38 <int-e> or maybe the type family needs an additional argument?
08:18:59 <int-e> "T t m" doesn't really make sense in connection with the declaration
08:19:33 <int-e> type T t :: (* -> *) -> *
08:19:35 <int-e> oops
08:19:47 <int-e> maybe it should be type T t m :: * -> (* -> *) -> *
08:20:16 <int-e> oh wait
08:20:28 <jpcooper> All named type arguments must appear in the parameters to the class
08:20:33 <int-e> Sorry, I'm misreading the declaration
08:20:56 <jpcooper> Basically I'm trying to understand how my definition differs to the GMap definition in the link
08:21:04 <int-e> But for that instantiation to work out you need to have type T (t :: *) (m :: * -> *) :: *
08:21:34 <jpcooper> m cannot be named in the associated type definition in the class definition, because it is not a parameter to the class
08:22:12 <jpcooper> Or have I misunderstood the docs? This is also highly possible
08:22:50 <int-e> But there are no type level lambdas... and what you want to do looks suspiciously like you'd need one.
08:23:33 ADG1089__ joins (~aditya@223.235.77.1)
08:23:53 <jpcooper> Does my definition differ particularly from the definition of GMap at 7.7.4.1 at https://downloads.haskell.org/~ghc/7.6.3/docs/html/users_guide/type-families.html, apart from the fact that my definition expects a (* -> *), and not a (*)?
08:24:06 <int-e> jpcooper: well, type T t (m :: * -> *) is accepted there.
08:24:37 MOSCOS joins (~MOSCOS@152.32.70.55)
08:24:59 <int-e> (as it should be, because the association of type families is on a syntactic level more than the semantic level)
08:25:56 Vulfe joins (~vulfe@2600:1702:31b0:34e0:a017:afb:342e:7f38)
08:26:46 <jpcooper> I stand corrected: "The type parameters must all be type variables, of course, and some (but not necessarily all) of then can be the class parameters. Each class parameter may only be used at most once per associated type"
08:27:01 <jpcooper> I would like m to remain free, though. Just like the (*) parameter in GMap
08:27:13 <int-e> jpcooper: the difference is that the GMap uses a data instance, and data type constructors *can* be partially applied
08:27:30 <jpcooper> Ahah!
08:27:45 × Mikagami quits (~MOSCOS@122.54.107.175) (Ping timeout: 240 seconds)
08:28:14 Mikagami joins (~MOSCOS@122.54.107.175)
08:28:18 <jpcooper> I believe you and would like to learn more. Do you have a source for this at https://downloads.haskell.org/~ghc/7.6.3/docs/html/users_guide/type-families.html or elsewhere which details this distinction?
08:28:34 <int-e> is there a reason why we're looking at the 7.6.3 docs?
08:28:55 o1lo01ol1o joins (~o1lo01ol1@92.250.37.12)
08:28:56 <jpcooper> There is no reason
08:29:45 × MOSCOS quits (~MOSCOS@152.32.70.55) (Ping timeout: 240 seconds)
08:30:38 × Vulfe quits (~vulfe@2600:1702:31b0:34e0:a017:afb:342e:7f38) (Ping timeout: 264 seconds)
08:31:03 <sMuNiX> jpcooper: TBH, I'd used data type families instead. I've posted an example at https://gist.github.com/jpcooper/6ba52c5bc1fbd79bc7adef6720851109
08:31:18 jamm joins (~jamm@unaffiliated/jamm)
08:31:36 <jpcooper> Thanks, sMuNiX
08:31:42 <int-e> jpcooper: Hmm is the linked wiki page useful?
08:32:43 <jpcooper> int-e: Sorry, which wiki page?
08:33:05 <jpcooper> sMuNiX: I was hoping to use a type, but this clearly isn't possible
08:33:30 × o1lo01ol1o quits (~o1lo01ol1@92.250.37.12) (Ping timeout: 272 seconds)
08:33:37 <int-e> jpcooper: https://wiki.haskell.org/GHC/Indexed_types (which is linked just before section 7.7.1 in the 7.6.3 version of the documentation)
08:34:21 <jpcooper> Thanks. Will read
08:35:47 × jamm quits (~jamm@unaffiliated/jamm) (Ping timeout: 260 seconds)
08:36:45 × machinedgod quits (~machinedg@135-23-192-217.cpe.pppoe.ca) (Ping timeout: 240 seconds)
08:38:22 <int-e> jpcooper: The wiki page links data family to data type definitions, and type families to type synonyms. So your problem translates to the one that type synonyms cannot be partially applied, because the Core language (increasingly loosely based on System F) has no type-level lambda.
08:40:24 kritzefitz joins (~kritzefit@fw-front.credativ.com)
08:41:43 <jpcooper> This is a shame, but makes sense
08:43:04 o1lo01ol1o joins (~o1lo01ol1@92.250.37.12)
08:43:34 Tuplanolla joins (~Tuplanoll@91-159-68-239.elisa-laajakaista.fi)
08:45:18 × ADG1089__ quits (~aditya@223.235.77.1) (Quit: Konversation terminated!)
08:45:59 m0rphism joins (~m0rphism@HSI-KBW-085-216-104-059.hsi.kabelbw.de)
08:46:16 Vulfe joins (~vulfe@2600:1702:31b0:34e0:a017:afb:342e:7f38)
08:47:46 nyd joins (~nyd@unaffiliated/elysian)
08:47:47 × o1lo01ol1o quits (~o1lo01ol1@92.250.37.12) (Ping timeout: 256 seconds)
08:48:42 × Kaiepi quits (~Kaiepi@47.54.252.148) (Ping timeout: 272 seconds)
08:49:53 × Sgeo quits (~Sgeo@ool-18b98aa4.dyn.optonline.net) (Read error: Connection reset by peer)
08:51:14 × Vulfe quits (~vulfe@2600:1702:31b0:34e0:a017:afb:342e:7f38) (Ping timeout: 268 seconds)
08:55:37 × heatsink quits (~heatsink@2600:1700:bef1:5e10:e906:26f8:b4d1:f41d) (Remote host closed the connection)
08:56:16 Kaiepi joins (~Kaiepi@47.54.252.148)
08:56:45 ADG1089__ joins (~aditya@223.235.77.1)
08:57:51 × ron3 quits (~ron@s91904426.blix.com) (Remote host closed the connection)
08:59:36 dandart joins (~Thunderbi@2a00:23c7:f5a6:d001:6cf9:1173:9e2a:3c85)
09:00:50 × Cerise quits (~jerry@unaffiliated/cerise) (Quit: :qa!)
09:00:52 × devalot quits (~ident@mail.pmade.com) (Quit: ZNC - http://znc.in)
09:00:56 × wowi42 quits (~wowi42@51.15.249.183) (Remote host closed the connection)
09:00:57 × mawk quits (mawk@serveur.io) (Quit: ZNC - https://znc.in)
09:01:12 mawk joins (mawk@serveur.io)
09:01:13 coot joins (~coot@37.30.50.187.nat.umts.dynamic.t-mobile.pl)
09:01:16 devalot joins (~ident@mail.pmade.com)
09:01:40 wowi42 joins (~wowi42@51.15.249.183)
09:02:14 × nineonine quits (~nineonine@S01061cabc0b095f3.vf.shawcable.net) (Remote host closed the connection)
09:02:25 × merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 240 seconds)
09:03:16 Franciman joins (~francesco@host-82-49-79-73.retail.telecomitalia.it)
09:04:15 Cerise joins (~jerry@natsumi.devzero.info)
09:04:15 × Cerise quits (~jerry@natsumi.devzero.info) (Changing host)
09:04:15 Cerise joins (~jerry@unaffiliated/cerise)
09:04:22 × dandart quits (~Thunderbi@2a00:23c7:f5a6:d001:6cf9:1173:9e2a:3c85) (Ping timeout: 260 seconds)
09:04:41 nineonine joins (~nineonine@S01061cabc0b095f3.vf.shawcable.net)
09:07:18 × danso quits (~dan@69-165-210-185.cable.teksavvy.com) (Quit: WeeChat 2.9)
09:07:20 wonko7 joins (~wonko7@2a01:e35:2ffb:7040:4535:f480:7dff:b3b5)
09:07:45 Gurkenglas joins (~Gurkengla@unaffiliated/gurkenglas)
09:08:59 heatsink joins (~heatsink@2600:1700:bef1:5e10:f1a7:76cd:a0f1:d0b7)
09:09:28 × nineonine quits (~nineonine@S01061cabc0b095f3.vf.shawcable.net) (Ping timeout: 256 seconds)
09:13:42 × heatsink quits (~heatsink@2600:1700:bef1:5e10:f1a7:76cd:a0f1:d0b7) (Ping timeout: 260 seconds)
09:13:43 × philopsos quits (~caecilius@gateway/tor-sasl/caecilius) (Ping timeout: 240 seconds)
09:14:11 o1lo01ol1o joins (~o1lo01ol1@92.250.37.12)
09:17:03 pmxb0t joins (~pmxb0t@185.204.1.185)
09:18:40 philopsos joins (~caecilius@gateway/tor-sasl/caecilius)
09:21:34 royal_screwup21 joins (52254809@gateway/web/cgi-irc/kiwiirc.com/ip.82.37.72.9)
09:22:26 neiluj joins (~jco@91-167-203-101.subs.proxad.net)
09:22:39 dandart joins (~Thunderbi@2a00:23c7:f5a6:d001:6cf9:1173:9e2a:3c85)
09:26:53 × royal_screwup21 quits (52254809@gateway/web/cgi-irc/kiwiirc.com/ip.82.37.72.9) (Ping timeout: 256 seconds)
09:27:13 × dandart quits (~Thunderbi@2a00:23c7:f5a6:d001:6cf9:1173:9e2a:3c85) (Ping timeout: 272 seconds)
09:27:19 jamm joins (~jamm@unaffiliated/jamm)
09:30:06 × ActinalWhomp quits (ad49c9f8@pool-173-73-201-248.washdc.fios.verizon.net) (Remote host closed the connection)
09:30:29 magma joins (~magma@host-79-22-138-220.retail.telecomitalia.it)
09:30:55 × ADG1089__ quits (~aditya@223.235.77.1) (Quit: Konversation terminated!)
09:30:59 royal_screwup21 joins (52254809@gateway/web/cgi-irc/kiwiirc.com/ip.82.37.72.9)
09:31:25 dandart joins (~Thunderbi@2a00:23c7:f5a6:d001:6cf9:1173:9e2a:3c85)
09:35:12 × jamm quits (~jamm@unaffiliated/jamm) (Remote host closed the connection)
09:35:30 jamm joins (~jamm@unaffiliated/jamm)
09:36:50 × wonko7 quits (~wonko7@2a01:e35:2ffb:7040:4535:f480:7dff:b3b5) (Quit: See You Space Cowboy..)
09:37:19 merijn joins (~merijn@83-160-49-249.ip.xs4all.nl)
09:40:58 ADG1089__ joins (~aditya@223.235.77.1)
09:44:05 nineonine joins (~nineonine@S01061cabc0b095f3.vf.shawcable.net)
09:45:26 × nineonine quits (~nineonine@S01061cabc0b095f3.vf.shawcable.net) (Remote host closed the connection)
09:46:29 nineonine joins (~nineonine@S01061cabc0b095f3.vf.shawcable.net)
09:47:55 × iqubic quits (~user@2601:602:9500:4870:e949:f050:eec9:86cb) (Remote host closed the connection)
09:48:28 × sdx23 quits (~sdx23@unaffiliated/sdx23) (Remote host closed the connection)
09:48:42 sdx23 joins (~sdx23@unaffiliated/sdx23)
09:49:25 iqubic joins (~user@2601:602:9500:4870:224c:ee6c:f171:d2ab)
09:49:59 hackage gitlab-haskell 0.2.4 - A Haskell library for the GitLab web API https://hackage.haskell.org/package/gitlab-haskell-0.2.4 (RobStewart)
09:51:17 × aidecoe quits (~aidecoe@unaffiliated/aidecoe) (Remote host closed the connection)
09:51:19 × nineonine quits (~nineonine@S01061cabc0b095f3.vf.shawcable.net) (Ping timeout: 260 seconds)
09:51:31 aidecoe joins (~aidecoe@unaffiliated/aidecoe)
09:52:16 cosimone joins (~cosimone@2001:b07:ae5:db26:d849:743b:370b:b3cd)
09:53:23 × philopsos quits (~caecilius@gateway/tor-sasl/caecilius) (Ping timeout: 240 seconds)
09:54:11 gehmehgeh joins (~ircuser1@gateway/tor-sasl/gehmehgeh)
09:56:43 × hnOsmium0001 quits (uid453710@gateway/web/irccloud.com/x-kgydrswmdfhxhpyo) (Quit: Connection closed for inactivity)
09:56:57 aveltras joins (uid364989@gateway/web/irccloud.com/x-swdjdvvylpuvvuuw)
09:58:52 × cole-h quits (~cole-h@c-73-48-197-220.hsd1.ca.comcast.net) (Ping timeout: 260 seconds)
10:00:45 Rudd0 joins (~Rudd0@185.189.115.108)
10:08:45 × jpcooper quits (~user@unaffiliated/jpcooper) (Ping timeout: 240 seconds)
10:09:04 × dandart quits (~Thunderbi@2a00:23c7:f5a6:d001:6cf9:1173:9e2a:3c85) (Ping timeout: 258 seconds)
10:09:34 dandart joins (~Thunderbi@host86-185-55-80.range86-185.btcentralplus.com)
10:10:35 × wei2912 quits (~wei2912@unaffiliated/wei2912) (Remote host closed the connection)
10:13:46 majjoha joins (5fae4106@95.174.65.6)
10:16:34 × cosimone quits (~cosimone@2001:b07:ae5:db26:d849:743b:370b:b3cd) (Remote host closed the connection)
10:16:54 cosimone joins (~cosimone@93-47-228-249.ip115.fastwebnet.it)
10:17:29 × jamm quits (~jamm@unaffiliated/jamm) (Remote host closed the connection)
10:20:56 shatriff joins (~vitaliish@176-52-216-242.irishtelecom.com)
10:23:50 jamm joins (~jamm@unaffiliated/jamm)
10:26:00 hackage Z-YAML 0.1.0.0 - YAML tools https://hackage.haskell.org/package/Z-YAML-0.1.0.0 (winterland)
10:26:03 livvy joins (~livvy@gateway/tor-sasl/livvy)
10:27:09 nineonine joins (~nineonine@S01061cabc0b095f3.vf.shawcable.net)
10:29:09 × nineonine quits (~nineonine@S01061cabc0b095f3.vf.shawcable.net) (Remote host closed the connection)
10:29:48 nineonine joins (~nineonine@S01061cabc0b095f3.vf.shawcable.net)
10:33:18 × royal_screwup21 quits (52254809@gateway/web/cgi-irc/kiwiirc.com/ip.82.37.72.9) (Ping timeout: 260 seconds)
10:34:05 × nineonine quits (~nineonine@S01061cabc0b095f3.vf.shawcable.net) (Ping timeout: 240 seconds)
10:36:32 × p-core quits (~Thunderbi@koleje-wifi-0045.koleje.cuni.cz) (Ping timeout: 260 seconds)
10:38:26 axeman- joins (~axeman_@2a02:8109:86c0:1f98:b552:2bd4:45ad:9d0e)
10:38:32 × justan0theruser quits (~justanoth@unaffiliated/justanotheruser) (Ping timeout: 268 seconds)
10:40:20 × axeman- quits (~axeman_@2a02:8109:86c0:1f98:b552:2bd4:45ad:9d0e) (Client Quit)
10:40:40 axeman- joins (~axeman_@2a02:8109:86c0:1f98:b552:2bd4:45ad:9d0e)
10:54:09 × shatriff quits (~vitaliish@176-52-216-242.irishtelecom.com) (Remote host closed the connection)
10:54:18 perrier-jouet joins (~perrier-j@modemcable012.251-130-66.mc.videotron.ca)
10:58:23 × axeman- quits (~axeman_@2a02:8109:86c0:1f98:b552:2bd4:45ad:9d0e) (Remote host closed the connection)
10:58:46 shatriff joins (~vitaliish@176-52-216-242.irishtelecom.com)
11:00:14 mounty joins (~mounty@210.1.196.133)
11:02:39 × ADG1089__ quits (~aditya@223.235.77.1) (Remote host closed the connection)
11:03:04 ADG1089__ joins (~aditya@223.235.77.1)
11:03:28 × ADG1089__ quits (~aditya@223.235.77.1) (Remote host closed the connection)
11:03:56 × Mikagami quits (~MOSCOS@122.54.107.175) (Remote host closed the connection)
11:04:26 Mikagami joins (~MOSCOS@122.54.107.175)
11:05:26 × Mikagami quits (~MOSCOS@122.54.107.175) (Remote host closed the connection)
11:05:51 Mikagami joins (~MOSCOS@122.54.107.175)
11:06:16 × kam1 quits (~kam1@24.231.108.143) (Ping timeout: 240 seconds)
11:06:17 kuribas joins (~user@ptr-25vy0i8vujxag7jvv73.18120a2.ip6.access.telenet.be)
11:06:59 <kuribas> I've been reading about clojure transducers, and it seems they are the CPS transformed version of Kleisli over a List transformer (done right).
11:07:26 × Mikagami quits (~MOSCOS@122.54.107.175) (Remote host closed the connection)
11:07:31 <kuribas> They also do side effects to handle state...
11:07:51 Mikagami joins (~MOSCOS@122.54.107.175)
11:09:40 × majjoha quits (5fae4106@95.174.65.6) (Ping timeout: 245 seconds)
11:10:30 heatsink joins (~heatsink@2600:1700:bef1:5e10:f1a7:76cd:a0f1:d0b7)
11:11:22 <kuribas> since forall r .(r -> b -> m r) -> (r -> a -> m r) ~= a -> (m r -> b -> m r) -> r -> m r ~= a -> ListT m b
11:11:37 <kuribas> so transducer composition is >=>
11:12:07 × ezzieyguywuf quits (~Unknown@unaffiliated/ezzieyguywuf) (Read error: Connection reset by peer)
11:12:53 <kuribas> mapping f = pure . f
11:13:13 kam1 joins (~kam1@24.231.108.143)
11:14:38 × kam1 quits (~kam1@24.231.108.143) (Remote host closed the connection)
11:15:02 × heatsink quits (~heatsink@2600:1700:bef1:5e10:f1a7:76cd:a0f1:d0b7) (Ping timeout: 264 seconds)
11:15:06 <kuribas> filtering p = \a -> if p a then ListT (pure Nil) else pure a
11:15:45 <kuribas> then "taking" would use an IOref to count the number of elements taken so far.
11:17:54 <kuribas> I suppose haskells streamly library is the closest thing to clojure transducers
11:18:06 × hexfive quits (~hexfive@50-47-142-195.evrt.wa.frontiernet.net) (Ping timeout: 256 seconds)
11:19:05 __monty__ joins (~toonn@unaffiliated/toonn)
11:20:33 axeman- joins (~axeman_@2a02:8109:86c0:1f98:b552:2bd4:45ad:9d0e)
11:20:42 heatsink joins (~heatsink@2600:1700:bef1:5e10:cc9a:202:e3b8:f08c)
11:21:02 × dandart quits (~Thunderbi@host86-185-55-80.range86-185.btcentralplus.com) (Remote host closed the connection)
11:22:19 dandart joins (~Thunderbi@host86-185-55-80.range86-185.btcentralplus.com)
11:23:53 plutoniix joins (~q@184.82.194.64)
11:24:00 × plutoniix quits (~q@184.82.194.64) (Max SendQ exceeded)
11:24:06 × ggVGc quits (~ggVGc@a.lowtech.earth) (Changing host)
11:24:06 ggVGc joins (~ggVGc@unaffiliated/walt)
11:24:28 plutoniix joins (~q@184.82.194.64)
11:24:37 lassulus_ joins (~lassulus@NixOS/user/lassulus)
11:24:49 × lassulus_ quits (~lassulus@NixOS/user/lassulus) (Client Quit)
11:25:24 × axeman- quits (~axeman_@2a02:8109:86c0:1f98:b552:2bd4:45ad:9d0e) (Ping timeout: 268 seconds)
11:25:32 × heatsink quits (~heatsink@2600:1700:bef1:5e10:cc9a:202:e3b8:f08c) (Ping timeout: 260 seconds)
11:27:10 lassulus_ joins (~lassulus@NixOS/user/lassulus)
11:27:13 majjoha joins (majjohamat@gateway/shell/matrix.org/x-nfknmskoomgvvhht)
11:27:20 × lassulus_ quits (~lassulus@NixOS/user/lassulus) (Client Quit)
11:27:57 × jamm quits (~jamm@unaffiliated/jamm) (Remote host closed the connection)
11:29:18 borne joins (~fritjof@200116b86409cb00c0a3d285e8e687f4.dip.versatel-1u1.de)
11:32:45 × lassulus quits (~lassulus@NixOS/user/lassulus) (Quit: WeeChat 2.9)
11:33:02 kam1 joins (~kam1@24.231.108.143)
11:33:55 lassulus joins (~lassulus@NixOS/user/lassulus)
11:37:24 vilpan parts (~0@212.117.1.172) ()
11:40:43 × kam1 quits (~kam1@24.231.108.143) (Remote host closed the connection)
11:42:01 kam1 joins (~kam1@24.231.108.143)
11:45:12 justan0theruser joins (~justanoth@unaffiliated/justanotheruser)
11:49:16 jamm joins (~jamm@unaffiliated/jamm)
11:53:08 <kuribas> so clojure transducers are fairly simple actually, not some super novel construct that can be only done using dynamic typing :)
11:53:59 hackage apecs-physics 0.4.5 - 2D physics for apecs https://hackage.haskell.org/package/apecs-physics-0.4.5 (jonascarpay)
11:55:01 rayyyy joins (~nanoz@gateway/tor-sasl/nanoz)
11:55:23 hacxman joins (~hexo@gateway/tor-sasl/hexo)
11:55:59 fendor joins (~fendor@178.165.130.57.wireless.dyn.drei.com)
11:56:23 × hexo quits (~hexo@gateway/tor-sasl/hexo) (Ping timeout: 240 seconds)
11:56:24 hacxman is now known as hexo
11:57:47 nineonine joins (~nineonine@S01061cabc0b095f3.vf.shawcable.net)
11:59:38 × nineonine quits (~nineonine@S01061cabc0b095f3.vf.shawcable.net) (Remote host closed the connection)
12:00:18 nineonine joins (~nineonine@S01061cabc0b095f3.vf.shawcable.net)
12:00:24 hexfive joins (~hexfive@50-47-142-195.evrt.wa.frontiernet.net)
12:02:03 <kuribas> so then the transduce function applies the transducer to each element, concatenates the results, and folds them.
12:04:54 × nineonine quits (~nineonine@S01061cabc0b095f3.vf.shawcable.net) (Ping timeout: 260 seconds)
12:04:58 Synthetica joins (uid199651@gateway/web/irccloud.com/x-arxbcjhlstycoeub)
12:05:28 × borne quits (~fritjof@200116b86409cb00c0a3d285e8e687f4.dip.versatel-1u1.de) (Ping timeout: 260 seconds)
12:08:37 × dandart quits (~Thunderbi@host86-185-55-80.range86-185.btcentralplus.com) (Ping timeout: 264 seconds)
12:09:03 cosimone_ joins (~cosimone@5.170.240.2)
12:10:20 × dftxbs3e quits (~dftxbs3e@unaffiliated/dftxbs3e) (Remote host closed the connection)
12:12:44 × cosimone quits (~cosimone@93-47-228-249.ip115.fastwebnet.it) (Ping timeout: 265 seconds)
12:12:45 cosimone_ is now known as cosimone
12:15:10 × vsiddharth quits (~user@c-73-15-251-38.hsd1.ca.comcast.net) (Ping timeout: 272 seconds)
12:15:45 royal_screwup21 joins (52254809@gateway/web/cgi-irc/kiwiirc.com/ip.82.37.72.9)
12:17:09 notzmv joins (~user@unaffiliated/zmv)
12:21:07 × royal_screwup21 quits (52254809@gateway/web/cgi-irc/kiwiirc.com/ip.82.37.72.9) (Quit: Connection closed)
12:21:29 royal_screwup21 joins (52254809@gateway/web/cgi-irc/kiwiirc.com/ip.82.37.72.9)
12:21:36 heatsink joins (~heatsink@2600:1700:bef1:5e10:cc9a:202:e3b8:f08c)
12:21:37 × christo quits (~chris@81.96.113.213) (Remote host closed the connection)
12:22:38 × qwerty quits (~tema@217.118.92.215) (Read error: Connection reset by peer)
12:23:28 <merijn> kuribas: transducers are just a mix of streaming libs like conduit and something like Tekmo's foldl library
12:24:06 × unlink2 quits (~unlink2@p200300ebcf259600971664e9499d7db7.dip0.t-ipconnect.de) (Remote host closed the connection)
12:24:53 qwerty joins (~tema@217.118.92.215)
12:25:10 <kuribas> except that the inner state seems to be done by a side effect in clojure
12:25:19 <kuribas> for example (take 5).
12:25:49 <kuribas> it uses an mutable ref to count the number of elements.
12:25:55 × royal_screwup21 quits (52254809@gateway/web/cgi-irc/kiwiirc.com/ip.82.37.72.9) (Ping timeout: 246 seconds)
12:25:56 × mputz quits (~Thunderbi@dslb-088-064-063-125.088.064.pools.vodafone-ip.de) (Ping timeout: 256 seconds)
12:25:58 unlink2 joins (~unlink2@p200300ebcf259600971664e9499d7db7.dip0.t-ipconnect.de)
12:26:05 <kuribas> so the foldl library would be a *clean* version of transducers :-)
12:26:26 × heatsink quits (~heatsink@2600:1700:bef1:5e10:cc9a:202:e3b8:f08c) (Ping timeout: 264 seconds)
12:26:33 christo joins (~chris@81.96.113.213)
12:29:11 × Stanley00 quits (~stanley00@unaffiliated/stanley00) ()
12:30:16 × sMuNiX quits (~sMuNiX@vlnsm8-montreal02-142-122-8-233.internet.virginmobile.ca) (Read error: Connection reset by peer)
12:30:36 × christo quits (~chris@81.96.113.213) (Ping timeout: 240 seconds)
12:32:26 sMuNiX joins (~sMuNiX@vlnsm8-montreal02-142-122-8-233.internet.virginmobile.ca)
12:34:05 Tario joins (~Tario@201.192.165.173)
12:36:42 knupfer joins (~Thunderbi@mue-88-130-61-079.dsl.tropolys.de)
12:40:25 <tomsmeding> is there a way to load an entire project in ghci, focus on a particular set of modules, and _keep that set intact_ on :reload ?
12:40:47 <kuribas> merijn: transducers are also CPS transformed, like the van laarhoven lens representation.
12:41:08 <merijn> tomsmeding: Define "entire project"
12:41:20 <tomsmeding> all modules in the main library of a cabal project
12:41:20 <merijn> tomsmeding: i.e. does that involve multiple components/packages?
12:41:21 <tomsmeding> in my case
12:41:23 <tomsmeding> nope
12:41:32 <tomsmeding> (well, stack project, but I _hope_ that doesn't matter)
12:41:41 <merijn> Then cabal repl should already reload it
12:41:45 <merijn> oh, stack
12:41:52 <kuribas> so they a specific form of traversal. The stream representation is basically the un-CPSed version.
12:41:54 <merijn> Stack uses ugly hacks to make multi-component ghci work
12:41:58 <tomsmeding> also starting up the repl takes like a minute so I'd like :r to work
12:42:01 <merijn> I have no clue how that may interfere
12:43:00 <tomsmeding> "Then cabal repl should already reload it" -- does that work well with :reload? i.e. if I do :reload, will it suddenly focus an arbitrary module instead of the one I had focused?
12:44:49 <kuribas> tomsmeding: by focus you mean :load?
12:45:15 <tomsmeding> :m
12:45:32 <tomsmeding> :l reloads the entire repl, :m doesn't
12:45:42 geekosaur joins (ac3a3bc9@172.58.59.201)
12:45:54 dftxbs3e joins (~dftxbs3e@unaffiliated/dftxbs3e)
12:45:55 mputz joins (~Thunderbi@dslb-088-064-063-125.088.064.pools.vodafone-ip.de)
12:46:08 <tomsmeding> but I'll try to reproduce on a non-stack project, it'll be easier to talk about what happens then
12:47:06 arybczak joins (~unknown@2a02:a312:c83d:7800:bb7f:5c00:4f48:cc5c)
12:47:55 Vulfe joins (~vulfe@2600:1702:31b0:34e0:a017:afb:342e:7f38)
12:47:59 FreeBirdLjj joins (~freebirdl@101.87.168.174)
12:48:30 dandart joins (~Thunderbi@2a00:23c7:f5a6:d001:6cf9:1173:9e2a:3c85)
12:49:23 <__monty__> Hmm, :m only adds modules to the context, no focusing afaik? And doesn't GHCi always keep those loaded?
12:49:44 <__monty__> Pretty sure if you want to unload those from the context you have to explicitly `:m - Module`
12:50:02 <tomsmeding> pure cabal project, single executable: https://paste.tomsmeding.com/tfS7EZaH
12:50:13 <tomsmeding> why does it re-focus main? I'd like to keep my module list the same
12:50:32 <tomsmeding> __monty__: indeed I can :m -Main, but then :r re-adds Main
12:50:50 <tomsmeding> pretty sure that is because it is the "top-level module" that's being loaded in ghci, but I couldn't care less about that :p
12:51:33 <merijn> I mean, what exactly is the problem?
12:52:05 <merijn> I have the module list disabled entirely, tbh
12:52:11 <tomsmeding> the problem, in the paste I linked, is that after :r I'm suddenly in the context of Main, which adds things to the scope that I might not want to be in scope
12:52:13 <merijn> Pointless waste of space >.>
12:52:22 × FreeBirdLjj quits (~freebirdl@101.87.168.174) (Ping timeout: 265 seconds)
12:52:27 <tomsmeding> here in pastebin-haskell it's not really an issue, but in another project there are significant name clashes between moduls
12:52:41 <tomsmeding> meaning that adding another module means lots of things are now suddenly ambiguous
12:52:42 × Vulfe quits (~vulfe@2600:1702:31b0:34e0:a017:afb:342e:7f38) (Ping timeout: 260 seconds)
12:53:01 × olligobber quits (~olligobbe@unaffiliated/olligobber) (Ping timeout: 264 seconds)
12:53:47 × mputz quits (~Thunderbi@dslb-088-064-063-125.088.064.pools.vodafone-ip.de) (Quit: mputz)
12:54:20 <__monty__> tomsmeding: I think the closest thing to what you want is to just start GHCi for each module you want to look at. Configure it to use -fobject-code to keep from having to interpret everything every time?
12:54:47 × Varis quits (~Tadas@unaffiliated/varis) (Remote host closed the connection)
12:55:35 × dandart quits (~Thunderbi@2a00:23c7:f5a6:d001:6cf9:1173:9e2a:3c85) (Ping timeout: 272 seconds)
12:55:56 solonarv joins (~solonarv@adijon-656-1-25-229.w90-13.abo.wanadoo.fr)
12:56:41 × aveltras quits (uid364989@gateway/web/irccloud.com/x-swdjdvvylpuvvuuw) (Quit: Connection closed for inactivity)
12:56:52 × plutoniix quits (~q@184.82.194.64) (Quit: Leaving)
12:57:00 <tomsmeding> __monty__: what do you mean exactly? Pass the modules I want as command-line arguments to ghci?
12:57:32 <tomsmeding> with stack I seem to be able to do that with --ghci-options, but I'm not sure how to do that with cabal
12:57:51 dandart joins (~Thunderbi@host86-185-55-80.range86-185.btcentralplus.com)
12:58:14 Varis joins (~Tadas@unaffiliated/varis)
12:58:42 <tomsmeding> also when I tried that with stack, it chose one of the two modules I passed as command-line arguments as the "main module" that it *-focuses after the reload (it always chooses the same one, ordering doesn't matter) -- and that happens to be the one I do _not_ want to have focused :p
12:58:49 <tomsmeding> (because I want that one imported qualified)
12:59:17 <__monty__> Then you can't pass it I think.
12:59:23 <tomsmeding> but probably most people don't want that precise control over the scope as I do
12:59:24 <__monty__> Add it afterwards.
12:59:25 _deepfire joins (~user@80.92.100.69)
12:59:45 <tomsmeding> with :l you mean?
12:59:57 <__monty__> No, import or :m.
13:00:05 borne joins (~fritjof@200116b86409cb00c0a3d285e8e687f4.dip.versatel-1u1.de)
13:00:22 <tomsmeding> it's not a dependency of the other module, so it doesn't get loaded by default so I can't import it
13:00:33 jmchael joins (~jmchael@81.174.205.210)
13:00:39 <tomsmeding> does that make sense? :p
13:01:17 <tomsmeding> I have two modules, A and B, and neither imports the other; I want A imported unqualified and B imported qualified in my repl, but if I pass A and B as command-line args then B is arbitrarily (?) chosen as the main module
13:01:34 heatsink joins (~heatsink@2600:1700:bef1:5e10:19ea:e852:616:ff9f)
13:01:51 <tomsmeding> passing only A or B as an argument prevents me from importing the other, because ghci only loads what is actually used
13:02:03 nineonine joins (~nineonine@S01061cabc0b095f3.vf.shawcable.net)
13:02:30 <tomsmeding> it's so frustrating because all would be fixed if ghci wouldn't re-focus its "top-level" module upon :reload :p
13:02:51 <tomsmeding> but I'll stop complaining
13:04:04 axeman- joins (~axeman_@2a02:8109:86c0:1f98:b552:2bd4:45ad:9d0e)
13:04:18 × nineonine quits (~nineonine@S01061cabc0b095f3.vf.shawcable.net) (Remote host closed the connection)
13:04:42 <__monty__> I think the assumption is what you're doing doesn't really make sense. If they don't import each other there's no way for the code to be used together. So if you want to experiment with both simultaneously you must logically have another module which does import both.
13:04:55 nineonine joins (~nineonine@S01061cabc0b095f3.vf.shawcable.net)
13:05:22 <tomsmeding> > If they don't import each other there's no way for the code to be used together.
13:05:25 <lambdabot> <hint>:1:15: error:
13:05:25 <lambdabot> <hint>:1:15: error: parse error on input ‘import’
13:05:26 <tomsmeding> disagree :p
13:05:47 <__monty__> Do tell?
13:05:52 <tomsmeding> the real project that I'm talking about (not pastebin-haskell) is a library
13:06:12 <tomsmeding> libraries can have exported modules A and B, neither importing the other, but still being quite useful to have them together
13:06:31 <__monty__> Yeah but only in other modules which import *both*.
13:06:32 × heatsink quits (~heatsink@2600:1700:bef1:5e10:19ea:e852:616:ff9f) (Ping timeout: 268 seconds)
13:07:21 <tomsmeding> if I load the entire project in ghci, which I can easily do with 'stack repl' or 'cabal repl', and then run :m A B, then I have exactly the setup I want
13:07:39 <tomsmeding> is that not an intended usage of ghci?
13:08:01 <tomsmeding> can be, just asking
13:08:09 <__monty__> The only way you can do it in GHCi is if the modules are part of a package GHCi knows about.
13:08:25 Vulfe joins (~vulfe@2600:1702:31b0:34e0:a017:afb:342e:7f38)
13:08:47 mastarija joins (~mastarija@93-138-112-136.adsl.net.t-com.hr)
13:09:46 × nineonine quits (~nineonine@S01061cabc0b095f3.vf.shawcable.net) (Ping timeout: 265 seconds)
13:10:30 <__monty__> That's what cabal repl does I believe add the entire package of the current project to the scope.
13:10:47 <merijn> It adds 1 component of the current package to the scope
13:11:02 <tomsmeding> and that's what I want! Except that also registers some sort of top-level module that it always re-adds to the in-scope modules upon reload
13:11:07 <tomsmeding> __monty__: https://paste.tomsmeding.com/zTZK933s
13:11:26 <tomsmeding> neither DB nor RecentList import any other modules from my project, only external deps
13:11:29 <__monty__> Right, not the scope, but it tells GHCi about the package.
13:12:42 <__monty__> tomsmeding: Maybe you want `cabal repl library:pastebin-haskell`?
13:12:51 ericsagnes joins (~ericsagne@2405:6580:0:5100:9fad:af1d:1031:f5b2)
13:13:04 × Vulfe quits (~vulfe@2600:1702:31b0:34e0:a017:afb:342e:7f38) (Ping timeout: 258 seconds)
13:13:59 <tomsmeding> __monty__: like this? https://paste.tomsmeding.com/ft7fhpvG
13:15:39 royal_screwup21 joins (52254809@gateway/web/cgi-irc/kiwiirc.com/ip.82.37.72.9)
13:16:11 Vulfe joins (~vulfe@2600:1702:31b0:34e0:a017:afb:342e:7f38)
13:16:24 × ericsagn1 quits (~ericsagne@2405:6580:0:5100:9938:b754:b7e6:63d5) (Ping timeout: 268 seconds)
13:16:31 <kuribas> merijn: actually, the clojure transducer model with side effects would be more like: type Transducer = IO (a -> ListT IO b)
13:16:59 <kuribas> as state is a done using a mutable reference.
13:17:20 <kuribas> the foldl library is much cleaner of course.
13:17:37 fuzzypixelz joins (~fuzzypixe@eth-west-pareq2-46-193-4-100.wb.wifirst.net)
13:17:43 <merijn> kuribas: Hence why I said foldl *and* streaming libraries (like conduit, etc.)
13:17:55 <kuribas> right
13:18:40 <kuribas> the explanation on the clojure reference page is also confusing...
13:18:49 <tomsmeding> __monty__ merijn: I'm just going to do this: :def rr Prelude.const (Prelude.return ":r\n:m -The.Offending.Main.Module\n")
13:21:28 <__monty__> tomsmeding: No, you're loading the exe component which has a main module. `cabal repl library`.
13:22:01 <tomsmeding> okay fair point this test project is an executable, not a library. I'll tell you however, for a library it will just choose an arbitrary module
13:22:08 <tomsmeding> let me look on my system for a suitable test cabal project
13:23:36 × tsrt^ quits (tsrt@ip98-184-89-2.mc.at.cox.net) ()
13:23:38 coot_ joins (~coot@37.30.50.187.nat.umts.dynamic.t-mobile.pl)
13:23:39 × guest1222 quits (~user@49.5.6.87) (Remote host closed the connection)
13:23:48 guest1222 joins (~user@49.5.6.87)
13:24:05 × cfricke quits (~cfricke@unaffiliated/cfricke) (Quit: WeeChat 3.0)
13:24:18 × coot quits (~coot@37.30.50.187.nat.umts.dynamic.t-mobile.pl) (Quit: coot)
13:24:18 coot_ is now known as coot
13:26:29 <tomsmeding> __monty__: https://paste.tomsmeding.com/dOdetwPi
13:26:57 <tomsmeding> I would like 'a' not to get in scope after :r
13:27:12 × axeman- quits (~axeman_@2a02:8109:86c0:1f98:b552:2bd4:45ad:9d0e) (Remote host closed the connection)
13:27:51 <tomsmeding> (and 'cabal repl lib:test' has exactly the same behaviour as 'cabal repl' in this case)
13:30:05 <__monty__> tomsmeding: Yeah, out of ideas then : /
13:31:19 Lycurgus joins (~niemand@cpe-45-46-137-210.buffalo.res.rr.com)
13:31:36 <tomsmeding> I'll go the ugly :def way :p
13:31:41 mastarija_ joins (~mastarija@93-136-165-235.adsl.net.t-com.hr)
13:31:58 tomsmeding is lucky the arbitrary top-level module is not one I want imported qualified
13:32:03 <kuribas> merijn: but the fold itself is just the transduce function, right?
13:32:23 Guest2398 joins (~daniel@pd95628ab.dip0.t-ipconnect.de)
13:32:56 × justan0theruser quits (~justanoth@unaffiliated/justanotheruser) (Ping timeout: 240 seconds)
13:33:22 <kuribas> merijn: because a fold cannot do filter or map.
13:33:36 <kuribas> or a transducer is a traversal over a fold...
13:35:36 × mastarija quits (~mastarija@93-138-112-136.adsl.net.t-com.hr) (Ping timeout: 272 seconds)
13:36:55 justanotheruser joins (~justanoth@unaffiliated/justanotheruser)
13:38:15 son0p joins (~son0p@181.136.122.143)
13:39:22 ADG1089__ joins (~aditya@122.163.225.112)
13:41:14 gremax joins (znc@torba.club)
13:42:42 × Guest2398 quits (~daniel@pd95628ab.dip0.t-ipconnect.de) (Quit: Lost terminal)
13:44:08 × coot quits (~coot@37.30.50.187.nat.umts.dynamic.t-mobile.pl) (Quit: coot)
13:45:16 × mrchampion quits (~mrchampio@38.18.109.23) (Ping timeout: 240 seconds)
13:45:20 Ariakenom joins (~Ariakenom@2001:9b1:efb:fc00:85c1:dfba:129c:d7ca)
13:45:30 × pavonia quits (~user@unaffiliated/siracusa) (Quit: Bye!)
13:45:48 × royal_screwup21 quits (52254809@gateway/web/cgi-irc/kiwiirc.com/ip.82.37.72.9) (Quit: Connection closed)
13:46:12 royal_screwup21 joins (52254809@gateway/web/cgi-irc/kiwiirc.com/ip.82.37.72.9)
13:47:48 axeman- joins (~axeman_@2a02:8109:86c0:1f98:b552:2bd4:45ad:9d0e)
13:49:45 × star_cloud quits (~star_clou@ec2-34-220-44-120.us-west-2.compute.amazonaws.com) (Ping timeout: 240 seconds)
13:50:04 sand_dull joins (~theuser@c-73-149-95-105.hsd1.ct.comcast.net)
13:52:13 encod3 joins (~encod3@45-154-157-94.ftth.glasoperator.nl)
13:52:33 × axeman- quits (~axeman_@2a02:8109:86c0:1f98:b552:2bd4:45ad:9d0e) (Ping timeout: 258 seconds)
13:53:24 vs^ joins (vs@ip98-184-89-2.mc.at.cox.net)
13:54:06 × royal_screwup21 quits (52254809@gateway/web/cgi-irc/kiwiirc.com/ip.82.37.72.9) (Quit: Connection closed)
13:54:17 Tops2 joins (~Tobias@dyndsl-095-033-020-064.ewe-ip-backbone.de)
13:54:25 × justanotheruser quits (~justanoth@unaffiliated/justanotheruser) (Read error: Connection reset by peer)
13:54:29 royal_screwup21 joins (52254809@gateway/web/cgi-irc/kiwiirc.com/ip.82.37.72.9)
13:55:09 star_cloud joins (~star_clou@ec2-34-220-44-120.us-west-2.compute.amazonaws.com)
13:55:33 mputz joins (~Thunderbi@dslb-088-064-063-125.088.064.pools.vodafone-ip.de)
13:55:47 <majjoha> Hi all. I've been trying to improve my Haskell chops lately, and I am currently working my way through Haskell Programming From First Principles. To use my newly acquired knowledge, I've built a small app that generates passphrases using EFF's wordlist, and I would really appreciate any feedback on how I can improve my code. In total, we are talking under 50 lines of code, and it can be found here:
13:55:48 <majjoha> https://github.com/majjoha/passphrase/tree/main/src/Passphrase. Any suggestions?
13:56:36 × notzmv quits (~user@unaffiliated/zmv) (Remote host closed the connection)
13:57:14 ezzieyguywuf joins (~Unknown@unaffiliated/ezzieyguywuf)
13:57:37 mrchampion joins (~mrchampio@38.18.109.23)
13:59:37 × royal_screwup21 quits (52254809@gateway/web/cgi-irc/kiwiirc.com/ip.82.37.72.9) (Ping timeout: 264 seconds)
14:00:39 <ADG1089__> is there a way to parse do blocks in pointfree
14:01:10 <merijn> majjoha: Looks mostly fine
14:01:12 <geekosaur> no, but you can switch to using >> and >>= instead of do
14:01:26 <ADG1089__> i thought the same
14:01:44 urodna joins (~urodna@unaffiliated/urodna)
14:01:45 <ADG1089__> any utility to do that already or will have to do manually or write one?
14:01:49 <merijn> majjoha: I'd probably move the "(+) . (*10)" in the fold in Dice.hs out into a named where block
14:02:16 heatsink joins (~heatsink@2600:1700:bef1:5e10:19ea:e852:616:ff9f)
14:02:47 <geekosaur> don't know if there's a standalone version of lambdabot's @undo
14:03:18 <geekosaur> @undo do { x <- a; b x }
14:03:19 <lambdabot> a >>= \ x -> b x
14:03:25 × nyd quits (~nyd@unaffiliated/elysian) (Ping timeout: 240 seconds)
14:03:54 <geekosaur> @. pl undo do { x <- a; b x }
14:03:55 <lambdabot> b =<< a
14:04:34 <majjoha> merijn: Thanks for the suggestion. It would probably be good for improving the readability.
14:04:39 <geekosaur> (had to fight with my client a bit, it really wants @ to refer to nicks :( )
14:06:06 <ADG1089__> i installed lamdabot locally
14:06:09 <ADG1089__> that should help
14:06:34 <solonarv> geekosaur: ghc -ddump-ds ;)
14:07:07 × heatsink quits (~heatsink@2600:1700:bef1:5e10:19ea:e852:616:ff9f) (Ping timeout: 260 seconds)
14:07:26 <geekosaur> I'd also point out that pointfree does little for readability
14:07:51 nineonine joins (~nineonine@S01061cabc0b095f3.vf.shawcable.net)
14:08:46 <ADG1089__> i wrote something in very verbose manner
14:08:53 <ADG1089__> i think it can be simplified so asking
14:09:01 <kuribas> majjoha: I tend to inline variables that are used only once.
14:09:10 <geekosaur> verbose is not necessarily bad
14:09:13 <kuribas> majjoha: also, use foldl', never use foldl :-)
14:09:48 <ADG1089__> this is what i am talking about: https://hastebin.com/ivulotupuq.sql
14:09:51 × nineonine quits (~nineonine@S01061cabc0b095f3.vf.shawcable.net) (Read error: Connection reset by peer)
14:09:53 <geekosaur> the general rule is to write so it can be read by humans
14:10:04 <ADG1089__> lot of dos and forMs
14:10:25 × kritzefitz quits (~kritzefit@fw-front.credativ.com) (Remote host closed the connection)
14:10:31 nineonine joins (~nineonine@S01061cabc0b095f3.vf.shawcable.net)
14:10:42 <ADG1089__> let me know if it is good as it is
14:10:46 <kuribas> ADG1089__: you can use guards with let
14:10:55 × mrchampion quits (~mrchampio@38.18.109.23) (Ping timeout: 246 seconds)
14:10:57 <kuribas> let formattedName | window == currentWindow = ...
14:11:30 <kuribas> :t for
14:11:31 <lambdabot> (Traversable t, Applicative f) => t a -> (a -> f b) -> f (t b)
14:11:33 <kuribas> :t forM
14:11:35 <lambdabot> (Traversable t, Monad m) => t a -> (a -> m b) -> m (t b)
14:11:59 <kuribas> ADG1089__: use for instead of forM
14:12:01 Darwin226 joins (5fa878fa@95.168.120.250)
14:12:25 <kuribas> and pure instead of return
14:12:44 <majjoha> kuribas: I'd normally do the same but I thought that it might be easier to reason about the code if they were extracted to variables. In the REPL, it seems that foldl and foldl' have the same type signatures. Can you elaborate on how they differ? :-)
14:13:00 <Darwin226> Does anyone know what the current timeline for GHC 9 looks like? Wiki says a final release is planned for tomorrow. Have there already been release candidates?
14:13:01 <fuzzypixelz> I've been looking for Megaparsec tutorials for a few hours now and almost all of them are outdated
14:13:02 <kuribas> majjoha: foldl' is strict in the accumulator
14:13:20 kritzefitz joins (~kritzefit@fw-front.credativ.com)
14:13:22 <merijn> kuribas: That's foldl from RIO, not sure if that one is lazy or strict
14:13:25 <fuzzypixelz> Everything is fine and dandy until I have to use their imports
14:13:49 <fuzzypixelz> apparently there was a Text.Megaparsec.String but not anymore
14:13:51 <merijn> oh, RIO also has lazy foldl, that's dumb
14:14:11 Feuermagier joins (~Feuermagi@213.178.26.41)
14:14:14 <kuribas> indeed
14:14:16 <merijn> Darwin226: There have been candidates, but I wouldn't hold my breath for tomorrow :p
14:14:40 <kuribas> majjoha: foldl is lazy in the accumulator which is never what you want
14:14:46 × nineonine quits (~nineonine@S01061cabc0b095f3.vf.shawcable.net) (Ping timeout: 246 seconds)
14:14:59 <Darwin226> merijn: Cool. If you had to guess, when would you expect a release?
14:15:36 <majjoha> I just checked the RIO documentation and it seems to have both so I should probably consider replacing it with foldl'. Thanks for the suggestion, kuribas.
14:15:55 mrchampion joins (~mrchampio@38.18.109.23)
14:18:27 <merijn> Darwin226: Anywhere between now and May? xD
14:18:28 ij joins (~ij@NixOS/user/siers)
14:18:47 bitmapper joins (uid464869@gateway/web/irccloud.com/x-smcwgzrhebufmvup)
14:19:00 zzaaqq joins (3de72001@61-231-32-1.dynamic-ip.hinet.net)
14:19:03 × Vulfe quits (~vulfe@2600:1702:31b0:34e0:a017:afb:342e:7f38) (Ping timeout: 260 seconds)
14:19:04 <ij> I need a constant size NxN matrix with fast lookup and mutations – what data type should I use? it's going to be a maze solver
14:19:05 × kam1 quits (~kam1@24.231.108.143) (Ping timeout: 240 seconds)
14:20:07 royal_screwup21 joins (52254809@gateway/web/cgi-irc/kiwiirc.com/ip.82.37.72.9)
14:20:32 × hiroaki quits (~hiroaki@2a02:810b:c63f:eea0::3) (Ping timeout: 268 seconds)
14:20:47 <kuribas> ij: matrix? https://hackage.haskell.org/package/matrices
14:21:05 × borne quits (~fritjof@200116b86409cb00c0a3d285e8e687f4.dip.versatel-1u1.de) (Ping timeout: 272 seconds)
14:21:43 × shutdown_-h_now quits (~arjan@2001:1c06:2d0b:2312:438:f47:3e76:14d7) (Ping timeout: 272 seconds)
14:22:17 × Lycurgus quits (~niemand@cpe-45-46-137-210.buffalo.res.rr.com) (Quit: Exeunt)
14:22:31 exodrifter joins (~exodrifte@cpe-173-172-173-93.tx.res.rr.com)
14:23:19 <ij> I was looking at this package, but I'm not sure whether the mutation API is simple enough
14:23:43 <ij> I actually need copies, I don't want to mutate in place. I guess that is the wrong word to use then
14:24:06 × jamm quits (~jamm@unaffiliated/jamm) (Remote host closed the connection)
14:24:52 Vulfe joins (~vulfe@2600:1702:31b0:34e0:a017:afb:342e:7f38)
14:25:00 × dandart quits (~Thunderbi@host86-185-55-80.range86-185.btcentralplus.com) (Ping timeout: 272 seconds)
14:25:43 jamm joins (~jamm@unaffiliated/jamm)
14:26:21 × exodrifter quits (~exodrifte@cpe-173-172-173-93.tx.res.rr.com) (Client Quit)
14:26:42 exodrifter joins (~exodrifte@cpe-173-172-173-93.tx.res.rr.com)
14:26:53 <kuribas> ij: you could also consider using a Map instead.
14:27:12 <kuribas> Map (Int, Int) Wathever
14:27:15 okad joins (~okad@ec2-18-135-78-237.eu-west-2.compute.amazonaws.com)
14:27:58 × gawen quits (~gawen@movzbl.root.sx) (Quit: cya)
14:28:27 gawen joins (~gawen@movzbl.root.sx)
14:28:48 shutdown_-h_now joins (~arjan@2001:1c06:2d0b:2312:5526:7bff:8975:9331)
14:29:17 × Vulfe quits (~vulfe@2600:1702:31b0:34e0:a017:afb:342e:7f38) (Ping timeout: 260 seconds)
14:29:22 <Rembane> ij: What to choose depends on how sparse or dense the matrix is.
14:30:00 <ij> all rows filled, it's going to be NxM (sorry, not NxN as said previously :/)
14:30:06 × Darwin226 quits (5fa878fa@95.168.120.250) (Remote host closed the connection)
14:30:27 × jamm quits (~jamm@unaffiliated/jamm) (Ping timeout: 260 seconds)
14:31:03 <kuribas> if you need fast incremental update, a map can be still useful.
14:31:32 <ij> maybe, but I know it will have to solve big mazes after it tackles the small ones
14:31:57 <kuribas> ij: anyway, the matrices packages support immutable matrices as well.
14:32:10 dandart joins (~Thunderbi@host86-185-55-80.range86-185.btcentralplus.com)
14:33:05 coot joins (~coot@37.30.50.187.nat.umts.dynamic.t-mobile.pl)
14:33:15 <ij> but it seems like I have to create a new one with each update – there's not going to be any sharing then, is there?
14:33:52 <ij> Data.Matrix from package `matrix' has a set function, so maybe I'll try that
14:36:24 machinedgod joins (~machinedg@135-23-192-217.cpe.pppoe.ca)
14:37:53 Sheilong joins (uid293653@gateway/web/irccloud.com/x-euoarczklgynbawz)
14:42:04 ddellacosta joins (dd@gateway/vpn/mullvad/ddellacosta)
14:42:19 hiroaki joins (~hiroaki@ip4d168e73.dynamic.kabel-deutschland.de)
14:45:14 Vulfe joins (~vulfe@2600:1702:31b0:34e0:a017:afb:342e:7f38)
14:47:55 <solonarv> it does have a 'set' function but that one will copy the entire matrix
14:48:20 × mputz quits (~Thunderbi@dslb-088-064-063-125.088.064.pools.vodafone-ip.de) (Ping timeout: 256 seconds)
14:48:44 Sgeo joins (~Sgeo@ool-18b98aa4.dyn.optonline.net)
14:49:58 × Vulfe quits (~vulfe@2600:1702:31b0:34e0:a017:afb:342e:7f38) (Ping timeout: 260 seconds)
14:50:00 × geekosaur quits (ac3a3bc9@172.58.59.201) (Remote host closed the connection)
14:53:25 × zzaaqq quits (3de72001@61-231-32-1.dynamic-ip.hinet.net) (Ping timeout: 245 seconds)
14:54:08 justanotheruser joins (~justanoth@unaffiliated/justanotheruser)
14:54:18 × leothrix quits (~leothrix@elastic/staff/leothrix) (Quit: ZNC 1.7.5 - https://znc.in)
14:56:17 leothrix joins (~leothrix@elastic/staff/leothrix)
14:56:27 × royal_screwup21 quits (52254809@gateway/web/cgi-irc/kiwiirc.com/ip.82.37.72.9) (Quit: Connection closed)
14:56:49 royal_screwup21 joins (52254809@gateway/web/cgi-irc/kiwiirc.com/ip.82.37.72.9)
15:00:30 nyd joins (~nyd@unaffiliated/elysian)
15:01:15 × son0p quits (~son0p@181.136.122.143) (Quit: leaving)
15:01:57 × royal_screwup21 quits (52254809@gateway/web/cgi-irc/kiwiirc.com/ip.82.37.72.9) (Ping timeout: 260 seconds)
15:03:01 heatsink joins (~heatsink@2600:1700:bef1:5e10:19ea:e852:616:ff9f)
15:03:42 nineonine joins (~nineonine@S01061cabc0b095f3.vf.shawcable.net)
15:04:27 Vulfe joins (~vulfe@2600:1702:31b0:34e0:a017:afb:342e:7f38)
15:04:45 × ridcully quits (~ridcully@pd951f4de.dip0.t-ipconnect.de) (Quit: server update)
15:05:32 × nineonine quits (~nineonine@S01061cabc0b095f3.vf.shawcable.net) (Remote host closed the connection)
15:06:11 nineonine joins (~nineonine@S01061cabc0b095f3.vf.shawcable.net)
15:07:04 superstar64 joins (6ccefa7c@108-206-250-124.lightspeed.miamfl.sbcglobal.net)
15:07:09 borne joins (~fritjof@200116b86409cb00c0a3d285e8e687f4.dip.versatel-1u1.de)
15:07:40 <superstar64> is it possible to use scott encoding with linear types?
15:08:01 × heatsink quits (~heatsink@2600:1700:bef1:5e10:19ea:e852:616:ff9f) (Ping timeout: 268 seconds)
15:08:20 <superstar64> for sum types, in a way that `\x -> f (\ .. x) (\ ... x)` works
15:09:15 xcmw joins (~textual@c-76-120-183-86.hsd1.pa.comcast.net)
15:09:32 × sw1nn quits (~sw1nn@2a00:23c6:2385:3a00:268a:d573:fb76:8521) (Ping timeout: 260 seconds)
15:10:25 × nineonine quits (~nineonine@S01061cabc0b095f3.vf.shawcable.net) (Ping timeout: 240 seconds)
15:11:43 × ddellacosta quits (dd@gateway/vpn/mullvad/ddellacosta) (Ping timeout: 268 seconds)
15:11:52 × bthom quits (~bthom@2601:184:4700:b89:abdc:f6d7:f8b7:16e2) (Ping timeout: 260 seconds)
15:14:41 SeasonsBeatings is now known as grumble
15:15:25 × jespada quits (~jespada@90.254.245.49) (Ping timeout: 240 seconds)
15:16:41 boothead joins (25192c87@37.25.44.135)
15:17:06 jespada joins (~jespada@90.254.245.49)
15:17:17 × fuzzypixelz quits (~fuzzypixe@eth-west-pareq2-46-193-4-100.wb.wifirst.net) (Quit: fuzzypixelz)
15:17:31 <boothead> nh2 are you still working on static-haskell-nix? (Hi by the way) :-)
15:18:20 × perrier-jouet quits (~perrier-j@modemcable012.251-130-66.mc.videotron.ca) (Quit: WeeChat 3.0)
15:21:03 plutoniix joins (~q@node-uov.pool-125-24.dynamic.totinternet.net)
15:22:42 fendor_ joins (~fendor@178.165.130.229.wireless.dyn.drei.com)
15:24:13 × sgibber2018 quits (~arch-gibb@208.85.237.137) (Ping timeout: 264 seconds)
15:25:34 × fendor quits (~fendor@178.165.130.57.wireless.dyn.drei.com) (Ping timeout: 260 seconds)
15:27:04 × al3x27 quits (~plovs@85.254.75.199) (Quit: WeeChat 2.9)
15:27:12 chang joins (~textual@host-173-230-65-85.njjcmar.clients.pavlovmedia.com)
15:27:22 al3x27 joins (~plovs@85.254.75.199)
15:28:21 Entertainment joins (~entertain@104.246.132.210)
15:28:41 perrier-jouet joins (~perrier-j@modemcable012.251-130-66.mc.videotron.ca)
15:29:14 × vikfret quits (~vikfret@2806:2f0:90e1:6afe:d1fc:fdcb:aaa3:aab6) (Read error: Connection reset by peer)
15:30:14 × toorevitimirp quits (~tooreviti@117.182.182.252) (Remote host closed the connection)
15:31:44 ridcully joins (~ridcully@pd951f4de.dip0.t-ipconnect.de)
15:33:10 nbloomf joins (~nbloomf@ip68-110-248-64.ks.ks.cox.net)
15:33:35 nyaomin is now known as nyaomi
15:33:56 × justanotheruser quits (~justanoth@unaffiliated/justanotheruser) (Ping timeout: 240 seconds)
15:36:05 × sand_dull quits (~theuser@c-73-149-95-105.hsd1.ct.comcast.net) (Ping timeout: 240 seconds)
15:37:41 devalot parts (~ident@mail.pmade.com) ("ERC (IRC client for Emacs 27.1)")
15:37:53 × robotmay quits (~beepboop@2001:8b0:7af0:2580:a48c:ccf9:aef1:cb86) (Remote host closed the connection)
15:38:06 jonatanb joins (~jonatanb@83.24.25.27.ipv4.supernova.orange.pl)
15:39:12 robotmay joins (~beepboop@2001:8b0:7af0:2580:9553:dae8:6cf1:18d0)
15:43:12 × berberman_ quits (~berberman@unaffiliated/berberman) (Quit: ZNC 1.7.5 - https://znc.in)
15:43:14 elfets joins (~elfets@ip-37-201-23-96.hsi13.unitymediagroup.de)
15:43:33 berberman joins (~berberman@unaffiliated/berberman)
15:44:44 × berberman quits (~berberman@unaffiliated/berberman) (Max SendQ exceeded)
15:45:33 berberman joins (~berberman@unaffiliated/berberman)
15:46:26 × coot quits (~coot@37.30.50.187.nat.umts.dynamic.t-mobile.pl) (Quit: coot)
15:47:03 × chang quits (~textual@host-173-230-65-85.njjcmar.clients.pavlovmedia.com) (Quit: My MacBook has gone to sleep. ZZZzzz…)
15:47:52 fuzzypixelz joins (~fuzzypixe@eth-west-pareq2-46-193-4-100.wb.wifirst.net)
15:47:58 × Vulfe quits (~vulfe@2600:1702:31b0:34e0:a017:afb:342e:7f38) (Remote host closed the connection)
15:48:03 × gxt quits (~gxt@gateway/tor-sasl/gxt) (Ping timeout: 240 seconds)
15:48:47 gxt joins (~gxt@gateway/tor-sasl/gxt)
15:50:44 hseg joins (~gesh@IGLD-84-228-238-87.inter.net.il)
15:51:37 × hseg quits (~gesh@IGLD-84-228-238-87.inter.net.il) (Client Quit)
15:53:05 × jonatanb quits (~jonatanb@83.24.25.27.ipv4.supernova.orange.pl) (Quit: Leaving...)
15:53:18 × nbloomf quits (~nbloomf@ip68-110-248-64.ks.ks.cox.net) (Quit: My MacBook has gone to sleep. ZZZzzz…)
15:55:37 × xff0x_ quits (~fox@2001:1a81:53e9:2700:db3b:366e:c891:aec7) (Ping timeout: 260 seconds)
15:55:59 eacameron joins (uid256985@gateway/web/irccloud.com/x-xmnchykalzjujusu)
15:56:02 xff0x_ joins (~fox@2001:1a81:53e9:2700:9d00:b502:3966:f8c0)
15:57:48 petersen joins (~petersen@redhat/juhp)
15:58:23 × exodrifter quits (~exodrifte@cpe-173-172-173-93.tx.res.rr.com) (Quit: Leaving.)
16:01:06 shapr reads the Map, but is still lost
16:01:35 <Rembane> shapr: Are you perhaps too Set in your ways?
16:01:52 <shapr> not sure if I approve of this Sequence of jokes
16:02:03 × rayyyy quits (~nanoz@gateway/tor-sasl/nanoz) (Ping timeout: 240 seconds)
16:02:35 <Rembane> If you want to, I can List them instead.
16:03:21 <shapr> I fold, this is getting too silly.
16:03:38 <xerox_> this got close to be de-Void of an end
16:03:43 heatsink joins (~heatsink@2600:1700:bef1:5e10:19ea:e852:616:ff9f)
16:04:05 nineonine joins (~nineonine@S01061cabc0b095f3.vf.shawcable.net)
16:04:08 <sm[m]> don't give up, you'll be Vectorious in the end
16:04:13 shapr laughs
16:04:37 × ADG1089__ quits (~aditya@122.163.225.112) (Remote host closed the connection)
16:04:39 × petersen quits (~petersen@redhat/juhp) (Ping timeout: 260 seconds)
16:04:48 <Rembane> I can see an Array of hope!
16:05:23 <shapr> this is one way to Reduce the seriousness of this channel.
16:05:33 <xerox_> I was wrong, there seem to be no Endo in sight
16:05:35 rayyyy joins (~nanoz@gateway/tor-sasl/nanoz)
16:06:12 × nineonine quits (~nineonine@S01061cabc0b095f3.vf.shawcable.net) (Remote host closed the connection)
16:06:23 <shapr> Is there some Alternative to these jokes?
16:06:37 <xerox_> maybe not Type-ing them
16:06:40 danso joins (~dan@69-165-210-185.cable.teksavvy.com)
16:06:44 nineonine joins (~nineonine@S01061cabc0b095f3.vf.shawcable.net)
16:06:55 <tomsmeding> but that would mean Return'ing to normality
16:07:02 <tomsmeding> which is Pure nonsense
16:07:07 × cosimone quits (~cosimone@5.170.240.2) (Ping timeout: 246 seconds)
16:07:08 <shapr> I guess this is a Symbol of our humor.
16:07:28 <sm[m]> I think we're just String-ing this along
16:07:42 <xerox_> it's not the First nor the Last time this happens
16:08:01 cr3 joins (~cr3@192-222-143-195.qc.cable.ebox.net)
16:08:27 × heatsink quits (~heatsink@2600:1700:bef1:5e10:19ea:e852:616:ff9f) (Ping timeout: 268 seconds)
16:08:50 <xerox_> did y'all finish your TypeRep ertoire?
16:09:26 hseg joins (~gesh@IGLD-84-228-238-87.inter.net.il)
16:09:34 × dandart quits (~Thunderbi@host86-185-55-80.range86-185.btcentralplus.com) (Ping timeout: 265 seconds)
16:09:40 boxscape joins (4ff0ba59@gateway/web/cgi-irc/kiwiirc.com/ip.79.240.186.89)
16:10:16 × qwerty quits (~tema@217.118.92.215) (Ping timeout: 240 seconds)
16:10:20 <xerox_> Either it's de Functor someone will come up with another
16:10:24 × boxscape quits (4ff0ba59@gateway/web/cgi-irc/kiwiirc.com/ip.79.240.186.89) (Client Quit)
16:10:35 boxscape joins (4ff0ba59@gateway/web/cgi-irc/kiwiirc.com/ip.79.240.186.89)
16:10:39 × borne quits (~fritjof@200116b86409cb00c0a3d285e8e687f4.dip.versatel-1u1.de) (Ping timeout: 272 seconds)
16:10:54 acarrico joins (~acarrico@dhcp-68-142-39-249.greenmountainaccess.net)
16:11:01 <shapr> I'm using humor to curry favor.
16:11:16 saep joins (~saep@94.31.86.216)
16:11:39 <boxscape> I saw in a mailing list tail defined in terms of foldr as `tail' l = foldr (\_ _ (_:ys) -> ys) id l l`. That seems like cheating though - it's using \(_:ys) -> ys, which is basically tails defined in terms of pattern matching. So this wouldn't work if you only had access to the church encoding of lists. Is there a way to do this without using
16:11:40 <boxscape> pattern matching?
16:11:44 <tomsmeding> some of these jokes are Confusing
16:11:48 <boxscape> s/tails/tail
16:11:55 <sm[m]> I think we've made a Hash of this
16:11:55 × nineonine quits (~nineonine@S01061cabc0b095f3.vf.shawcable.net) (Ping timeout: 272 seconds)
16:11:58 <tomsmeding> have to View them through the Right Lens
16:12:19 <Rembane> I wonder if there are any puns Left now.
16:12:29 <sm[m]> the Optics are bad
16:12:33 <xerox_> hahah
16:13:43 <superstar64> boxscape, maybe try scott encoding if you can instead
16:14:22 <superstar64> then it would be `tail list = list (error "lol') (\_ xs -> xs)`
16:14:45 <boxscape> superstar64 this started because I was trying to figure out how to write the scott encoding in terms of the church encoding, which seems very similar to defining tail
16:14:55 <superstar64> oh
16:15:12 <dolio> boxscape: There are ways, but they either involve weird types or don't perform very well.
16:15:22 <boxscape> dolio I'm okay with that :)
16:16:13 <superstar64> are there any papers that compare linearity on the arrow vs linearity on the kind?
16:16:20 <superstar64> and uniqueness types vs linear types?
16:16:25 × magma quits (~magma@host-79-22-138-220.retail.telecomitalia.it) (Quit: bye)
16:16:33 <sm[m]> xerox_++, "... de Functor ..." 😆
16:16:34 justsomeguy joins (~justsomeg@unaffiliated/--/x-3805311)
16:17:03 cosimone joins (~cosimone@93-47-228-249.ip115.fastwebnet.it)
16:17:10 <superstar64> is linearity on the kind and uniqueness types the same thing?
16:17:23 Vulfe joins (~vulfe@2600:1702:31b0:34e0:a017:afb:342e:7f38)
16:17:26 <dolio> boxscape: The way without weird types is to rebuild the entire list with one less element.
16:17:38 <superstar64> the linear haskell paper has a small section on this, but i'm wondering if there's any more
16:18:05 <dolio> Uniqueness types are not the same as any kind of linearity.
16:18:52 <hseg> hi. context is http://ix.io/2Jhn. trying to keep only keys k s.t. embed p k is in keysSet (ds p), mapping k to embed p k for the minimal p for which this is true
16:19:34 × o1lo01ol1o quits (~o1lo01ol1@92.250.37.12) (Remote host closed the connection)
16:19:44 dandart joins (~Thunderbi@host86-185-55-80.range86-185.btcentralplus.com)
16:19:45 <dolio> boxscape: The other possibility is to come with some non-strictly positive type to fold into. But I don't know what exactly it should look like for tail.
16:19:55 <hseg> unfortunately, the implementation i give expands such k to (`embed` k) <$> [p..w'] for such p
16:20:01 <superstar64> dolio what's the difference then?
16:20:16 <hseg> help getting this into shape?
16:20:20 <boxscape> dolio I see. I think I figured out the first way.. tail' l = fst $ foldr (\x (_, xs) -> (xs, x:xs)) (error "no", []) l
16:20:36 <dolio> The non-strictly positive one might be able to avoid rebuilding the list.
16:20:59 <boxscape> what is a strictly positive type?
16:22:17 × tomboy64 quits (~tomboy64@gateway/tor-sasl/tomboy64) (Remote host closed the connection)
16:22:24 <dolio> Strictly positive means that the type being defined only occurs to the right of arrows in its fields' types.
16:22:31 <boxscape> I see
16:23:30 <dolio> So, like, `newtype Hyper a b = H ((Hyper a b -> b) -> a)` is positive, because it occurs to the left of two nested arrows, but not strictly positive.
16:23:59 × shf quits (~sheaf@2a01:cb19:80cc:7e00:a9e0:e776:ec99:db91) (Read error: Connection reset by peer)
16:24:09 <hseg> hrm.. in fact, it seems what i want is a mapKeysMaybe :: (k -> Maybe l) -> Map k v -> Map l v
16:24:15 <boxscape> okay
16:25:08 <tomsmeding> hseg: Data.Map.Strict.alter ?
16:25:11 christo joins (~chris@81.96.113.213)
16:25:12 <boxscape> sounds like.. a type that is covariant in all of its parameters would be strictly positive
16:25:17 <tomsmeding> oh sorry keys
16:25:25 <hseg> yeah...
16:25:38 <hseg> once i have such a combinator the rest is pretty easy
16:25:43 <tomsmeding> you aren't going to be able to do that any more performantly than going via a list though
16:25:53 <tomsmeding> unless you know that your k -> Maybe l function is monotonic
16:26:30 <tomsmeding> (meaning that x <= y <-> f x <= f y)
16:26:30 <solonarv> boxscape: other way around. a strictly positive type must be covariant, but e.g. 'newtype Cont r a = Cont ((a -> r) -> r)' is not strictly positive but still covariant
16:26:31 <dolio> boxscape: No.
16:26:35 × fradet quits (~pi@216.252.75.247) (Read error: Connection reset by peer)
16:26:53 <boxscape> oh, okay
16:26:54 <hseg> ... not really -- it finds the minimal p such that embed p k `elem` keysSet (ds p) and maps k to embed p k
16:27:00 <dolio> boxscape: A 'positive' type is a fixed point of a covariant functor. Strictly positive is an even stronger condition than covariant.
16:27:09 <boxscape> I see
16:27:16 jamm joins (~jamm@unaffiliated/jamm)
16:27:21 <tomsmeding> hseg: I'm talking about that mapKeysMaybe you proposed
16:28:04 <hseg> yeah... i'm saying that under these constraints, I wouldn't be able to use mapKeysMaybe
16:28:21 <justsomeguy> (Please ignore that -- wrong channel.)
16:29:00 <tomsmeding> :t \f -> M.fromList . catMaybes . map (\(k,v) -> (,v) <$> f k) . M.assocs
16:29:02 <lambdabot> Ord k => (t -> Maybe k) -> M.Map t a -> M.Map k a
16:29:08 <tomsmeding> ¯\_(ツ)_/¯
16:29:37 × christo quits (~chris@81.96.113.213) (Ping timeout: 256 seconds)
16:29:47 <hseg> hrm. for hashmaps this might be doable
16:29:51 <tomsmeding> hseg: if you knew f was monotonic, you could use fromAscList instead of fromList there
16:30:01 tzh joins (~tzh@c-24-21-73-154.hsd1.wa.comcast.net)
16:30:34 <hseg> and considering that i don't really care about accessing keys in order, hashmaps might work for my usecase
16:31:09 tomboy64 joins (~tomboy64@gateway/tor-sasl/tomboy64)
16:31:54 <justsomeguy> hyiltiz: Nevermind; I'll make it work. Sorry for the trouble.
16:32:34 Ariakenom_ joins (~Ariakenom@2001:9b1:efb:fc00:e4fe:4113:e091:bcc)
16:35:05 × ulidtko|k quits (~ulidtko@194.54.80.38) (Ping timeout: 240 seconds)
16:35:17 <boxscape> okay I managed to do the scott encoding, too -- scott cons nil l = snd . foldr (\x (xs, _) -> (x:xs, cons x xs)) ([], nil)
16:35:28 <boxscape> (the inefficient version, anyway)
16:36:36 <dolio> I'm not really certain there is an efficient version, even with weird types.
16:36:37 × Ariakenom quits (~Ariakenom@2001:9b1:efb:fc00:85c1:dfba:129c:d7ca) (Quit: Leaving)
16:37:20 <dolio> There might be an efficient version with an actual Church encoding.
16:37:24 hekkaidekapus joins (~tchouri@gateway/tor-sasl/hekkaidekapus)
16:37:42 ulidtko|k joins (~ulidtko@193.111.48.79)
16:38:44 <dolio> If you're realizing to lists, though, there's not as much room to play tricks.
16:39:08 <boxscape> hm, okay
16:39:49 ulidtko|kk joins (~ulidtko@194.54.80.38)
16:41:23 <boxscape> solonarv isn't Cont only covariant in a, not in r?
16:41:43 × hekkaidekapus] quits (~tchouri@gateway/tor-sasl/hekkaidekapus) (Ping timeout: 240 seconds)
16:42:22 × justsomeguy quits (~justsomeg@unaffiliated/--/x-3805311) (Ping timeout: 268 seconds)
16:42:26 × ulidtko|k quits (~ulidtko@193.111.48.79) (Ping timeout: 265 seconds)
16:43:33 justsomeguy joins (~justsomeg@2603:9000:960a:fc00:c4d2:5b73:c7b7:3a2b)
16:43:33 × justsomeguy quits (~justsomeg@2603:9000:960a:fc00:c4d2:5b73:c7b7:3a2b) (Changing host)
16:43:33 justsomeguy joins (~justsomeg@unaffiliated/--/x-3805311)
16:43:46 <solonarv> boxscape: yes, I meant to specify "in a" but forgot
16:44:08 × fresheyeball quits (~isaac@c-71-237-105-37.hsd1.co.comcast.net) (Quit: WeeChat 2.7.1)
16:44:16 <boxscape> solonarv it seems like that wouldn't be a counter-example to what I said, then, since I said "covariant in *all* of its parameters"
16:44:27 fresheyeball joins (~isaac@c-71-237-105-37.hsd1.co.comcast.net)
16:44:43 <solonarv> I could easily have replaced 'r' with, say, 'Int' or whatever
16:45:20 nineonine joins (~nineonine@S01061cabc0b095f3.vf.shawcable.net)
16:45:21 <boxscape> hmm
16:45:28 × kritzefitz quits (~kritzefit@fw-front.credativ.com) (Remote host closed the connection)
16:45:49 bitmagie joins (~Thunderbi@200116b806efa400c8baafc3789c3ca0.dip.versatel-1u1.de)
16:45:52 <boxscape> right I confused recursive use of the type with use of a type parameter
16:45:56 × justsomeguy quits (~justsomeg@unaffiliated/--/x-3805311) (Client Quit)
16:46:05 <dolio> Anyhow, the thing I'm familiar with is doing zip more efficiently, and that is worse than tail in itself, because what happens there is that you need to do repeated rebuilds of one list based on the other, I think. The weird type solves that.
16:46:34 <boxscape> ok
16:46:58 <dolio> So it might be more like thinking about how to do `drop` efficiently on both a Church numeral and a Church list.
16:47:08 × nineonine quits (~nineonine@S01061cabc0b095f3.vf.shawcable.net) (Remote host closed the connection)
16:47:21 <dolio> And tail can't really be significantly more efficient.
16:47:38 geekosaur joins (42d52137@66.213.33.55)
16:47:45 nineonine joins (~nineonine@S01061cabc0b095f3.vf.shawcable.net)
16:47:45 <boxscape> I see
16:47:58 <dolio> It's only sequences of tails that could be.
16:48:19 justsomeguy joins (~justsomeg@2603:9000:960a:fc00:c4d2:5b73:c7b7:3a2b)
16:48:19 × justsomeguy quits (~justsomeg@2603:9000:960a:fc00:c4d2:5b73:c7b7:3a2b) (Changing host)
16:48:19 justsomeguy joins (~justsomeg@unaffiliated/--/x-3805311)
16:48:32 <fuzzypixelz> https://markkarpov.com/tutorial/megaparsec.html
16:48:48 <fuzzypixelz> Is an exellent Megaparsec tutorial
16:49:04 <dolio> Because the 'rebuild' strategy makes n tails do n² work.
16:49:10 <fuzzypixelz> Huge thanks to the author
16:49:22 <boxscape> yeah that makes sense
16:49:29 <gentauro> I wish somebody renamed MegaParsec to MegaTron
16:49:41 <gentauro> and the GHC Marge-Bot to Bot-tom
16:50:03 <gentauro> Bot-Tom is the correct name
16:50:31 kam1 joins (~kam1@24.231.108.143)
16:52:12 × nineonine quits (~nineonine@S01061cabc0b095f3.vf.shawcable.net) (Ping timeout: 256 seconds)
16:56:04 × perrier-jouet quits (~perrier-j@modemcable012.251-130-66.mc.videotron.ca) (Quit: WeeChat 3.0)
16:57:09 elisper joins (uid468625@gateway/web/irccloud.com/x-gymqncrzgoacrejr)
16:57:13 royal_screwup21 joins (52254809@gateway/web/cgi-irc/kiwiirc.com/ip.82.37.72.9)
16:57:29 <ocharles> Does anyone know if it's possible to use Cabal's "mixins" to rename a signature? I want to `build-depends: monad-signature` and then `mixins: monad-signature (Control.Monad.Sig as MyMonad)`, but Cabal complains there's no exposed module called Control.Monad.Sig (correct, it's a signature, not a module)
16:58:19 <ocharles> I want to do this because I might want to duplicate a signature into two places - e.g., MyMonad1 and MyMonad2 are both the same as Control.Monad.Sig
16:59:48 <ocharles> Ah! You use "requires" to rename signatures
17:00:11 cybersyn joins (~user@115.79.31.1)
17:00:17 × cybersyn quits (~user@115.79.31.1) (Quit: ERC (IRC client for Emacs 27.1))
17:00:21 <dcoutts> ocharles: I'm glad you figured it out, 'coz I've no idea! :-)
17:00:27 <ocharles> :)
17:00:50 <dcoutts> but I'm glad to see you're exercising the feature :-)
17:01:33 <ocharles> Trying to see if I can squeeze out a little Christmas blog post in the next few days - everyone likes a bit of Backpack stuff
17:01:48 <dcoutts> nice
17:02:04 × royal_screwup21 quits (52254809@gateway/web/cgi-irc/kiwiirc.com/ip.82.37.72.9) (Ping timeout: 256 seconds)
17:03:33 wroathe joins (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net)
17:05:58 <fuzzypixelz> ok bear with me, why do we need Functors when we can just bind to a function
17:06:38 × superstar64 quits (6ccefa7c@108-206-250-124.lightspeed.miamfl.sbcglobal.net) (Remote host closed the connection)
17:06:41 × concept2 quits (~concept2@unaffiliated/tubo) (Quit: See ya later!)
17:06:57 <fuzzypixelz> certainly the function we will use with Functor is going to have a different type sig than the one we use with bind
17:07:27 <fuzzypixelz> a -> b vs. a -> m b
17:07:57 <dcoutts> fuzzypixelz: you mean why do we have fmap f x, when we could just use x >>= return . f ?
17:08:01 <geekosaur> there are more Functors than Monads
17:08:03 <fuzzypixelz> dcoutts: yes
17:08:11 <dcoutts> ok, then what geekosaur said
17:08:21 <bitmapper> agh i don't have the free disk space to use stack
17:08:23 kupi joins (uid212005@gateway/web/irccloud.com/x-ejbvangncrpxemxc)
17:08:53 × matryoshka quits (~matryoshk@2606:6080:1002:8:3285:30e:de43:8809) (Ping timeout: 268 seconds)
17:08:55 <dcoutts> All instances of Monad are in Functor, but not the other way around. There are things that are functors but are not monads (or even Applicative).
17:09:24 <kupi> which is more widely use in the Haskell community? & and >>> from vanilla haskell or |> and .> from the flow package?
17:09:34 <dcoutts> fuzzypixelz: it's one of these hierarchy of abstraction things
17:09:43 matryoshka joins (~matryoshk@184.75.223.227)
17:09:52 <geekosaur> this might be a good time to recommend the Typeclassopedia
17:10:03 <merijn> kupi: I've never even heard of the flow package, tbh :p
17:10:32 <merijn> kupi: & is used with lens a lot, >>> basically never
17:10:38 <kupi> merijn: i have never seen & and >>> used besides in my code tbh :D
17:10:45 × matryoshka quits (~matryoshk@184.75.223.227) (Client Quit)
17:11:19 <boxscape> & is used a lot with lens
17:11:30 concept2 joins (~concept2@unaffiliated/tubo)
17:11:32 <boxscape> oh
17:11:32 matryoshka joins (~matryoshk@184.75.223.227)
17:11:36 <boxscape> merijn already said as much
17:11:41 <kupi> also there is <&> so getting used to & pays off well
17:11:48 <dcoutts> kupi: I've been writing Haskell for 20 years and I think never used any of those.
17:12:23 × matryoshka quits (~matryoshk@184.75.223.227) (Client Quit)
17:12:31 ddellacosta joins (dd@gateway/vpn/mullvad/ddellacosta)
17:12:37 <kupi> so I should get used to right to left composition and write code that way?
17:12:47 matryoshka joins (~matryoshk@2606:6080:1002:8:3285:30e:de43:8809)
17:13:04 <merijn> kupi: Probably, because you'll encounter a lot like that :)
17:13:11 <c_wraith> It's not so hard to get used to the identifiers being in the exact same order as they would be otherwise
17:13:13 <kupi> it's really weird for me i have to read the function names from right to left but the read the calls from left to right
17:13:30 <c_wraith> Is it hard to read foo (bar (baz x))?
17:13:41 axeman- joins (~axeman_@2a02:8109:86c0:1f98:b552:2bd4:45ad:9d0e)
17:13:58 × wroathe quits (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Ping timeout: 256 seconds)
17:14:28 <kupi> c_wraith: compared to "x & baz & bar & foo" and "baz >>> bar >>> foo" i think yes
17:14:36 <c_wraith> also... in Haskell, foo is the first function called there anyway. bar is only called if foo analyzes its argument
17:15:00 <dcoutts> kupi: yes, it's worth just getting used to. Don't think about order of "doing calls", but what is being computed.
17:15:10 <merijn> kupi: I think you'll find a lot of people confused by that style :)
17:15:23 <kupi> i know that's not the case because of lazy evaluation
17:15:37 coot joins (~coot@37.30.50.187.nat.umts.dynamic.t-mobile.pl)
17:16:01 <tomsmeding> I find myself reading (.) pipelines from right to left too
17:16:04 <tomsmeding> you get used to it :p
17:16:55 <tomsmeding> the fact that lazy evaluation reverses things somewhat is irrelevant to getting an understanding of what the code is intending to do, except for the most obscure special cases where the laziness matters in this
17:18:04 <c_wraith> that doesn't seem obscure to me...
17:18:07 kritzefitz joins (~kritzefit@212.86.56.80)
17:18:32 × encod3 quits (~encod3@45-154-157-94.ftth.glasoperator.nl) (Remote host closed the connection)
17:18:38 <c_wraith> The #1 way to prevent laziness from being a non-local problem is to pay attention to it locally.
17:18:56 erisco joins (~erisco@104-195-141-253.cpe.teksavvy.com)
17:19:05 encod3 joins (~encod3@45-154-157-94.ftth.glasoperator.nl)
17:19:30 <fuzzypixelz> dcoutts: so it's Monad < Functor < Applicative ?
17:19:59 <dcoutts> fuzzypixelz: nearly, Applicative comes between Functor and Monad
17:20:18 <tomsmeding> c_wraith: just ~1 hour ago I posted this function composition here: \f -> M.fromList . catMaybes . map (\(k,v) -> (,v) <$> f k) . M.assocs
17:20:43 <tomsmeding> there I definitely read right-to-left, and laziness certainly doesn't matter here in any important way
17:20:47 nineonine joins (~nineonine@S01061cabc0b095f3.vf.shawcable.net)
17:20:57 × xcmw quits (~textual@c-76-120-183-86.hsd1.pa.comcast.net) (Quit: My MacBook has gone to sleep. ZZZzzz…)
17:21:04 <c_wraith> Import Data.Bifunctor, please!
17:21:07 <c_wraith> :P
17:21:07 <tomsmeding> this is the usual situation in my experience, but then the code I write is very computational :p
17:21:11 juuandyy joins (~juuandyy@90.166.144.65)
17:21:30 <tomsmeding> as opposed to e.g. code that dives into the kmettiverse
17:22:28 <tomsmeding> c_wraith: I honestly don't see how 'bimap' makes that code shorter, since there's the <$>
17:22:35 × nineonine quits (~nineonine@S01061cabc0b095f3.vf.shawcable.net) (Remote host closed the connection)
17:22:43 × encod3 quits (~encod3@45-154-157-94.ftth.glasoperator.nl) (Remote host closed the connection)
17:22:49 <c_wraith> If you're not considering laziness there, that's very dangerous. The code happens to behave well, but you really should *know* that instead of getting lucky.
17:22:56 <fuzzypixelz> Ah, then when people say "Applicative Functor" they just mean Applicative right?
17:22:59 encod3 joins (~encod3@45-154-157-94.ftth.glasoperator.nl)
17:23:10 nineonine joins (~nineonine@S01061cabc0b095f3.vf.shawcable.net)
17:23:29 <hseg> hrm. so hashmaps *could* help in my scenario, except unordered-containers provides no api for modifiying the keys. Though, if from/toList are fusable, could just implement my function in terms of [(k,v)] and wrap it in a hashmap iso
17:23:29 <boxscape> fuzzypixelz yeah there's a lot of `<adjective> functor` classes that are just called `<adjective>`
17:23:31 <c_wraith> `Applicative' is the type class for the idea of applicative functors
17:23:36 <tomsmeding> c_wraith: there's a reason I use Data.Map.Strict, I guess?
17:23:56 × encod3 quits (~encod3@45-154-157-94.ftth.glasoperator.nl) (Client Quit)
17:23:57 <tomsmeding> and Data.Map.Lazy only for, well, up until now only advent of code :p
17:24:00 <c_wraith> tomsmeding: that's irrelevant
17:24:09 <boxscape> or.. some, anyway
17:24:27 <c_wraith> tomsmeding: that code functions identically with either.
17:24:47 <c_wraith> Which is... again... one of those things you should know, rather than get lucky with
17:24:53 <tomsmeding> fair point
17:25:21 <boxscape> hm does "Biapplicative" stand for "biapplicative functor" or "biapplicative bifunctor"?
17:25:40 <boxscape> oh I should just read the docs
17:25:47 <boxscape> it says "biapplicative bifunctors"
17:26:45 <c_wraith> tomsmeding: as to your other point... I can actually read it either way. "create a map from by removing the elements filtered out by this transformation on the keys"
17:26:54 <c_wraith> -from
17:27:35 <c_wraith> It sort of feels more operational to read right-to-left
17:28:04 × nineonine quits (~nineonine@S01061cabc0b095f3.vf.shawcable.net) (Ping timeout: 260 seconds)
17:28:13 <tomsmeding> true; also this is very subjective :) In this case I find the operational reading helpful in understanding what the intention is. If I'd want to analyse how it actually performs, I'd I guess read left-to-right
17:29:03 <tomsmeding> but point taken about laziness, I generally am aware of what I'm doing but I could be more aware :p
17:29:29 hackage pandoc-plot 1.0.1.0 - A Pandoc filter to include figures generated from code blocks using your plotting toolkit of choice. https://hackage.haskell.org/package/pandoc-plot-1.0.1.0 (LaurentRDC)
17:30:00 <c_wraith> I did recently find a laziness thing that surprised me
17:30:12 × CitizenSnips quits (~CitizenSn@irc.refl.club) (Quit: ZNC 1.8.2 - https://znc.in)
17:30:50 <c_wraith> Mostly because I wrote the code, it worked, then I realized what that implied.
17:30:53 <c_wraith> (lazy reasoning!)
17:32:07 <c_wraith> The way containers does the lazy/strict split where the same type is used for both, the only difference is the behavior of the functions you import? Doesn't actually work with functions defined in a class
17:33:36 <c_wraith> I used traverse over an IntMap, knowing I wanted it to be non-strict in the values. So I had imported Data.IntMap.Lazy. Only after it worked did I realize the import couldn't change the behavior of traverse as long as the types were the same
17:35:18 berberman_ joins (~berberman@unaffiliated/berberman)
17:35:43 × livvy quits (~livvy@gateway/tor-sasl/livvy) (Ping timeout: 240 seconds)
17:36:09 × berberman quits (~berberman@unaffiliated/berberman) (Ping timeout: 272 seconds)
17:36:12 <tomsmeding> heh yes that's a nice trip-up, and an interesting conundrum if you actually wanted the strict behaviour
17:36:29 × berberman_ quits (~berberman@unaffiliated/berberman) (Max SendQ exceeded)
17:36:56 berberman joins (~berberman@unaffiliated/berberman)
17:38:52 × jespada quits (~jespada@90.254.245.49) (Quit: Leaving)
17:39:03 ADG1089__ joins (~aditya@122.163.225.112)
17:39:47 <fuzzypixelz> I'm following along in a Megaparsec tutorial, and I found this expression: `(,,) <$> char 'a' <*> char 'b' <*> char 'c'` here char 'a' is of type Identity Char, question is: how does operator precedence work here?
17:40:10 heatsink joins (~heatsink@2600:1700:bef1:5e10:19ea:e852:616:ff9f)
17:40:11 <c_wraith> all the operators are infixl 4
17:40:21 CitizenSnips joins (~CitizenSn@irc.refl.club)
17:40:56 <c_wraith> basically, all the applicative sequencing operators are infixl 4, and that's important for understanding applicative parsers :)
17:41:16 <fuzzypixelz> infixl 4 ?
17:41:43 wroathe joins (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net)
17:41:57 <c_wraith> ah. when you define an operator in Haskell, you can also define its associativity and precedence
17:42:34 <c_wraith> infixl means they associate so the nesting is on the left. 4 is the precedence.
17:43:26 <c_wraith> you can mix different operators with the same precedence as long as they associate the same direction
17:44:38 <c_wraith> so that is parsed as (((,,) <$> char 'a') <*> char 'b') <*> char 'c'
17:44:42 × heatsink quits (~heatsink@2600:1700:bef1:5e10:19ea:e852:616:ff9f) (Ping timeout: 260 seconds)
17:45:04 <fuzzypixelz> c_wraith: oh I was just about to ask for parentheses :D
17:45:34 <c_wraith> yeah, I knew they were important. just a bit slow to type on my phone :)
17:46:07 × Franciman quits (~francesco@host-82-49-79-73.retail.telecomitalia.it) (Quit: Leaving)
17:46:24 × wroathe quits (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Ping timeout: 272 seconds)
17:46:58 × cosimone quits (~cosimone@93-47-228-249.ip115.fastwebnet.it) (Quit: cosimone)
17:47:56 × justsomeguy quits (~justsomeg@unaffiliated/--/x-3805311) ()
17:48:02 × Forlorn quits (~Forlorn@unaffiliated/forlorn) (Ping timeout: 264 seconds)
17:48:29 <hseg> hrm. annoyingly, (,)'s functor/foldable/etc instances apply to its second parameter, so there's no convenient way of golfing (a -> Maybe b) -> (a,c) -> Maybe (b,c)
17:49:54 <fuzzypixelz> Now I get it the first nested expression is of type m (Char -> Char -> (Char, Char, Char)) the next is m (Char -> (Char, Char, Char)) and the entire thing is indeed m (Char, Char, Char)
17:50:40 <c_wraith> fwiw, these are what I think of as the applicative sequencing operators: (<$), (<$>), (<*>), (<*), and (*>). the first 4 are pretty common for me to chain together when writing an applicative parser. the last one is a sort of special case, and not usually used in big chains without parenthesis
17:51:17 <ephemient> I end up with <$ or $> a good chunk of the time too
17:51:39 × fresheyeball quits (~isaac@c-71-237-105-37.hsd1.co.comcast.net) (Quit: WeeChat 2.7.1)
17:51:51 <c_wraith> my list started with <$ :P
17:52:24 <fuzzypixelz> right now I only know about <$> and <*>
17:52:47 <c_wraith> those are the most important ones.
17:52:58 <c_wraith> the others are just shortcuts for special cases
17:53:08 livvy joins (~livvy@gateway/tor-sasl/livvy)
17:53:09 <boxscape> hseg use its Bifunctor and Bifoldable instances?
17:53:25 heatsink joins (~heatsink@2600:1700:bef1:5e10:19ea:e852:616:ff9f)
17:54:13 × juuandyy quits (~juuandyy@90.166.144.65) (Ping timeout: 264 seconds)
17:54:32 ulidtko|k joins (~ulidtko@194.54.80.38)
17:54:37 × cr3 quits (~cr3@192-222-143-195.qc.cable.ebox.net) (Ping timeout: 256 seconds)
17:54:48 Forlorn joins (~Forlorn@unaffiliated/forlorn)
17:55:07 × mastarija_ quits (~mastarija@93-136-165-235.adsl.net.t-com.hr) (Quit: Leaving)
17:55:13 × ulidtko|kk quits (~ulidtko@194.54.80.38) (Read error: Connection reset by peer)
17:56:04 juuandyy joins (~juuandyy@90.166.144.65)
17:57:43 <lyxia> that's biapplicative
17:58:10 <lyxia> er, bitraversable
17:58:30 hackage bglib 3.0.0.0 - Implementation of the BGAPI serial protocol https://hackage.haskell.org/package/bglib-3.0.0.0 (tamasFabian)
17:58:41 <boxscape> I suppose I should have said bifunctor/bifoldable/etc to stay with the pattern
17:59:00 <hseg> ah, forgot about that, checking
18:00:04 × geekosaur quits (42d52137@66.213.33.55) (Ping timeout: 245 seconds)
18:00:48 <boxscape> % :t \(f :: a -> Maybe b) (p :: (a, c)) -> bitraverse f pure p
18:00:48 <yahb> boxscape: (a -> Maybe b) -> (a, c) -> Maybe (b, c)
18:01:25 shf joins (~sheaf@2a01:cb19:80cc:7e00:2de3:1260:1cbd:fa3e)
18:01:34 <boxscape> % :t bitraverse ?? pure
18:01:34 <yahb> boxscape: (Bitraversable t, Applicative f) => (a1 -> f c) -> t a1 a2 -> f (t c a2)
18:02:13 <boxscape> ^ hseg
18:02:27 × jamm quits (~jamm@unaffiliated/jamm) (Remote host closed the connection)
18:02:31 <hseg> ty
18:02:33 <fuzzypixelz> why is <*> only available to Applicatives?
18:02:48 <fuzzypixelz> shouldn't functors also have it?
18:03:09 <boxscape> fuzzypixelz there are functors that can't do it
18:03:29 <fuzzypixelz> to me, it doesn't seem like <$> isn't much different than <*>
18:04:06 <boxscape> apparently `data Const a b = Const a` is an example, I think
18:04:45 <glguy> instance Monoid m => Applicative (Const m)
18:05:06 <boxscape> ah, well, at least least for non-monoids then :)
18:06:05 jamm joins (~jamm@unaffiliated/jamm)
18:06:13 <boxscape> fuzzypixelz this thread may be interesting to you https://stackoverflow.com/questions/7220436/good-examples-of-not-a-functor-functor-applicative-monad
18:06:14 <fuzzypixelz> I take it it's simply the way the hierarchy was constructed? I mean, Functors _can_ contain functions?
18:06:34 <tomsmeding> Is there a standard list of Functors-that-are-not-Applicatives, Applicatives-that-are-not-Monads, Foldables-that-are-not-Traversables, etc?
18:06:58 <boxscape> fuzzypixelz yes, although the "container" point of view doesn't necessarily make sense for all functors
18:07:38 <boxscape> fuzzypixelz `Const Int` for example is a functor, but a value `Const Int String` doesn't contain a String
18:07:45 <boxscape> s/value/value of
18:07:57 <hseg> hrm. examples there all fail Applicative due to not being able to write pure
18:07:58 cr3 joins (~cr3@192-222-143-195.qc.cable.ebox.net)
18:08:20 <hseg> but Apply lacks it -- does anyone have an example of a non-Apply?
18:08:23 nineonine joins (~nineonine@S01061cabc0b095f3.vf.shawcable.net)
18:08:31 <fuzzypixelz> the way I see it: if they can "contain" functions then I should be able to use <*> on them
18:08:42 × nineonine quits (~nineonine@S01061cabc0b095f3.vf.shawcable.net) (Remote host closed the connection)
18:08:56 nineonine joins (~nineonine@S01061cabc0b095f3.vf.shawcable.net)
18:09:11 <boxscape> fuzzypixelz I wouldn't be surprised if all functors for which the "container" metaphor makes sense are, in fact, applicative functors
18:09:26 <hseg> that is true - they're all representable
18:09:57 <hseg> all "container" functors are isomorphic to a functor ((->) s) for s some type of shapes
18:10:14 xcmw joins (~textual@c-76-120-183-86.hsd1.pa.comcast.net)
18:10:28 × kam1 quits (~kam1@24.231.108.143) (Ping timeout: 272 seconds)
18:10:36 <hseg> ... wait, no, that's wrong. mixing up intuitions
18:10:38 × jamm quits (~jamm@unaffiliated/jamm) (Ping timeout: 260 seconds)
18:10:38 <tomsmeding> For what s is [] isomorphic to ((->) s) ?
18:10:48 <hseg> exactly, misspoke
18:10:50 <fuzzypixelz> but don't functors already have <$>? Doesn't that require the "container metaphor"?
18:11:38 <tomsmeding> newtype Const a b = Const a ; instance Functor (Const a) where fmap _ x = x -- fuzzypixelz
18:12:01 <hseg> not really. your type index can always be phantom (i.e. point to nothing)
18:12:03 <tomsmeding> Okay no, fmap _ (Const a) = Const a
18:12:06 <hseg> cf tomsmeding's example
18:12:14 × axeman- quits (~axeman_@2a02:8109:86c0:1f98:b552:2bd4:45ad:9d0e) (Remote host closed the connection)
18:13:48 <boxscape> it's also somewhat questionable if a function a -> b is really a container of bs
18:13:51 × Foritus quits (~buggery@cpc91316-watf11-2-0-cust68.15-2.cable.virginm.net) (Quit: ლ(ಠ益ಠლ) .:. <Ashley> my porn is hidden in a folder called "BBC Micro Emulator")
18:14:02 <boxscape> though from a certain point of view, it is
18:15:47 <tomsmeding> Random thought: the container analogy doesn't really work always. (a -> Bool) is a set in a very real sense, but it's not a functor (not even with any Ord shenanigans)
18:16:19 <boxscape> right but that's contravariant in a
18:16:27 axeman- joins (~axeman_@2a02:8109:86c0:1f98:b552:2bd4:45ad:9d0e)
18:16:40 <boxscape> the container thing applies to covariant functors, typically, no?
18:16:49 <hseg> yeah, but that's because there's two powerset functors, one covariant the other contravariant
18:16:56 <hseg> a -> Bool is the contravariant one
18:17:04 <boxscape> oh or do you mean...
18:17:14 <boxscape> even though it's a container it's not a covariant functor?
18:17:23 <tomsmeding> Yes that's what I meant
18:17:26 <boxscape> I see
18:17:37 Foritus joins (~buggery@cpc91316-watf11-2-0-cust68.15-2.cable.virginm.net)
18:17:37 × xff0x_ quits (~fox@2001:1a81:53e9:2700:9d00:b502:3966:f8c0) (Ping timeout: 260 seconds)
18:17:44 <monochrom> "container" is so intuitive it's going to violate every mathematical definition.
18:18:00 <hseg> yup
18:18:00 <monochrom> (That's a stab on intuition, btw)
18:18:13 xff0x_ joins (~fox@2001:1a81:53e9:2700:a9f9:6cd7:9a2:daa4)
18:18:15 <tomsmeding> Also Const is a bad example because it's weird, (a,) is also a non-applicative functor if a is not a monoid
18:18:29 <hseg> or a push for a research programme into clarifying this intuition
18:18:37 <tomsmeding> Credits 3rd answer to the SE link posted a while ago
18:19:03 <tomsmeding> Is (a,b) a container of b's?
18:19:08 <tomsmeding> 🤷‍♂️
18:19:35 <boxscape> hm
18:20:07 <fuzzypixelz> I'm already lost
18:20:23 <hseg> yeah. so basically, functor counterexamples are due to variance, pointed counterexamples are due to positive unpointed types, ...
18:20:46 <hseg> not sure about the apply and monad counterexamples
18:21:18 <boxscape> @src ap
18:21:18 <lambdabot> ap = liftM2 id
18:21:33 <hseg> what's the intuition behind (a^Int + a^String) not being an apply instance?
18:21:57 <tomsmeding> fuzzypixelz: different way of looking at it: functors are exactly those types for which <$> exists, and you can't define <*> in terms of <$>
18:22:05 × knupfer quits (~Thunderbi@mue-88-130-61-079.dsl.tropolys.de) (Ping timeout: 240 seconds)
18:22:19 kam1 joins (~kam1@24.231.108.143)
18:22:23 carthia joins (~carthia@gateway/tor-sasl/carthia)
18:22:25 <tomsmeding> the fact that there are types for which <$> exists but <*> doesn't justifies the fact that we look at functors as a separate thing
18:23:13 <hseg> fuzzypixelz: <$> allows you to push $ under the functor. <*> allows you to push (,)
18:23:27 × heatsink quits (~heatsink@2600:1700:bef1:5e10:19ea:e852:616:ff9f) (Remote host closed the connection)
18:23:39 <hseg> currying means that <$> + <*> allows you to apply any number of parameters to a function
18:23:59 cole-h joins (~cole-h@c-73-48-197-220.hsd1.ca.comcast.net)
18:24:53 lassulus_ joins (~lassulus@NixOS/user/lassulus)
18:25:00 <monochrom> I add that some things use just fmap. For example "data FreeMonad f a = U a | C (f (FreeMonad f a))", to make FreeMonad F a monad, we just need F to be a functor.
18:25:11 <boxscape> you can't define <$> in terms of <*> without pure, right?
18:25:48 × lassulus quits (~lassulus@NixOS/user/lassulus) (Ping timeout: 260 seconds)
18:26:11 lassulus_ is now known as lassulus
18:26:22 <monochrom> Actually even that is too advanced as an example.
18:27:36 <monochrom> "newtype Mu f a = Mu (f (Mu f a))" the catamorphism for Mu F just needs F to be a functor.
18:28:26 <monochrom> Actually why do I need "a" there? Heh
18:28:42 <monochrom> "newtype Mu f = Mu (f (Mu f))"
18:29:54 <hseg> yup - initial algebra for a functor
18:30:07 geekosaur joins (42d52137@66.213.33.55)
18:30:09 <boxscape> I'm wondering if there are types for which <*> exists but <$> doesn't, but considering the <*> laws use <$>, that might be a meaningless questoin
18:30:14 <c_wraith> boxscape: correct. the types don't even come close without pure
18:30:22 <boxscape> right
18:30:38 christo joins (~chris@81.96.113.213)
18:31:04 <hseg> hrm. would it make sense to have a monoidal endomap on Hask that isn't functorial?
18:31:28 <hseg> i.e. f s.t. you have () -> f (), (f a, f b) -> f (a,b) and nothing else
18:32:16 × nyd quits (~nyd@unaffiliated/elysian) (Ping timeout: 240 seconds)
18:32:31 heatsink joins (~heatsink@2600:1700:bef1:5e10:19ea:e852:616:ff9f)
18:34:04 justsomeguy joins (~justsomeg@216.186.218.241)
18:34:04 × justsomeguy quits (~justsomeg@216.186.218.241) (Changing host)
18:34:04 justsomeguy joins (~justsomeg@unaffiliated/--/x-3805311)
18:35:19 <hseg> ok, it seems the non-apply example in the SO post comes from requiring that a functor sum_s f(s) with s pointed must have f(s) monoidal
18:36:04 <hseg> or wait, no
18:36:10 <hseg> that's overcomplicating things
18:36:27 ulidtko|k is now known as ulidtko
18:36:38 <boxscape> it seems like there must be examples that don't involve pointedness considering you can't implement <*> without <$>, ignoring pure
18:36:44 <boxscape> er
18:36:51 <boxscape> s/without/in terms of
18:37:01 <boxscape> kind of a big difference :)
18:40:07 × juuandyy quits (~juuandyy@90.166.144.65) (Ping timeout: 272 seconds)
18:42:53 <hseg> for an example of an unpointed applicative, consider all "finite map" types - their pure should be const, but that is defined at infinitely many values
18:43:18 × coot quits (~coot@37.30.50.187.nat.umts.dynamic.t-mobile.pl) (Quit: coot)
18:44:55 <boxscape> I mean an example of a functor for which you can say that it cannot be an applicative without invoking pure
18:45:03 <boxscape> i.e. a Functor which isn't an instance of Apply
18:45:48 <hseg> oh wait. what about monoidal contravariant type
18:46:16 <solonarv> (co)yoneda f is a functor but nothing else, assuming f is at most a functor
18:46:34 <boxscape> hm I see
18:46:57 <boxscape> but wait
18:47:06 <boxscape> solonarv you just pushed the problem onto f
18:47:08 nitrix is now known as nitrix-mas
18:47:18 <boxscape> that's only an example if such an f exists
18:47:23 <hseg> (flip (->) m) should work, no?
18:47:28 <solonarv> f can be literally anything of kind Type -> Type
18:47:43 <hseg> i.e. type MonoidEval m a = a -> m
18:47:54 <solonarv> hseg: that's not a Functor though
18:48:05 <hseg> that's the point, we're looking for Apply-Functor
18:48:08 <boxscape> solonarv oh are you saying Yoneda f is a functor even if f isn't?
18:48:13 <solonarv> exactly!
18:48:16 <boxscape> I see
18:48:24 <boxscape> that is an example then, true
18:49:08 <hseg> nm my example, got some wires crossed
18:49:11 <erisco> if you have a category with fixed points what sort of category do you have?
18:50:05 <hseg> what, all maps have fixed points?
18:50:37 <erisco> I am not sure, what sort of categorical interpretations of fixpoints are there?
18:50:46 <monochrom> It is best to require continuous partial orders before you ask for fixed points.
18:50:46 <hseg> https://ncatlab.org/nlab/show/fixed+point
18:50:50 × dandart quits (~Thunderbi@host86-185-55-80.range86-185.btcentralplus.com) (Remote host closed the connection)
18:51:46 × Foritus quits (~buggery@cpc91316-watf11-2-0-cust68.15-2.cable.virginm.net) (Remote host closed the connection)
18:51:49 <monochrom> And so, have an O-category (every homset is a continuous partial order), then it has fixed points, and the fixed points are actually usable because they come from the continuous partial orders.
18:52:01 o1lo01ol1o joins (~o1lo01ol1@bl8-213-81.dsl.telepac.pt)
18:52:40 <monochrom> Indeed, fixed points in programming are usable because they come from continuous partial orders, not because they are merely axiomatized to exist out of the blue.
18:53:07 dandart joins (~Thunderbi@host86-185-55-80.range86-185.btcentralplus.com)
18:53:14 <monochrom> Because, for example, you need the partial order to even have fixed-point fusion.
18:55:24 hnOsmium0001 joins (uid453710@gateway/web/irccloud.com/x-puqqxfwctkhqhqmf)
18:55:45 Foritus joins (~buggery@cpc91316-watf11-2-0-cust68.15-2.cable.virginm.net)
18:56:25 × o1lo01ol1o quits (~o1lo01ol1@bl8-213-81.dsl.telepac.pt) (Ping timeout: 240 seconds)
18:56:45 <ezzieyguywuf> why does this order matter? `./setup build; ./setup haddock; ./setup test` -> doctests fail. `./setup haddock; ./setup build; ./setup test` -> doctests pass
18:56:53 <ezzieyguywuf> I've been using machines-0.7.1 to investigate
18:57:36 × dandart quits (~Thunderbi@host86-185-55-80.range86-185.btcentralplus.com) (Remote host closed the connection)
18:57:46 × cr3 quits (~cr3@192-222-143-195.qc.cable.ebox.net) (Ping timeout: 265 seconds)
18:57:49 × cheater quits (~user@unaffiliated/cheater) (Ping timeout: 264 seconds)
18:59:15 philopsos joins (~caecilius@gateway/tor-sasl/caecilius)
18:59:58 dandart joins (~Thunderbi@host86-185-55-80.range86-185.btcentralplus.com)
19:02:00 × kam1 quits (~kam1@24.231.108.143) (Remote host closed the connection)
19:02:25 kam1 joins (~kam1@24.231.108.143)
19:03:31 berberman_ joins (~berberman@unaffiliated/berberman)
19:04:13 <erisco> so the category of types, for all morphisms f : T ↝ T there is the fixpoint Mu f : T yes? because f (Mu f) = Mu f
19:04:49 × berberman quits (~berberman@unaffiliated/berberman) (Ping timeout: 268 seconds)
19:05:05 × xcmw quits (~textual@c-76-120-183-86.hsd1.pa.comcast.net) (Quit: My MacBook has gone to sleep. ZZZzzz…)
19:05:11 <erisco> if you have such a category, where all morphisms have fixpoints, is there any particular name for that?
19:05:59 <fuzzypixelz> is `void m a` he same as `_ <- m a` ?
19:06:03 × asheshambasta quits (~user@ptr-e1lysaxt4bg7tmaahx1.18120a2.ip6.access.telenet.be) (Ping timeout: 268 seconds)
19:06:10 <monochrom> Yes.
19:06:19 <merijn> Define "same" :p
19:06:23 <monochrom> void (m a)
19:06:38 × kam1 quits (~kam1@24.231.108.143) (Remote host closed the connection)
19:06:46 <erisco> one is an expression and the other is a syntax fragment
19:07:15 kam1 joins (~kam1@24.231.108.143)
19:07:17 <monochrom> I wouldn't be anal about that.
19:08:01 × kuribas quits (~user@ptr-25vy0i8vujxag7jvv73.18120a2.ip6.access.telenet.be) (Quit: ERC (IRC client for Emacs 26.3))
19:08:03 <merijn> also, expressions are arguably also "syntax fragments", so...
19:08:50 <erisco> can you REPL it
19:08:54 <monochrom> I would save my anality for, for example, "I got a type error, what should I do?", and even after being pressed to post actual code, only a screenshot is posted.
19:09:12 <fuzzypixelz> I asking because the tutorial I'm reading says `void :: Functor f => f a -> f () is used to explicitly discard the result to parsing, without we would get warnings about unused values from GHC.`
19:09:27 <fuzzypixelz> but I don't think GHC will complain if I use _
19:09:35 <monochrom> And for "does Traversable mean container?"
19:10:00 × CitizenSnips quits (~CitizenSn@irc.refl.club) (Remote host closed the connection)
19:10:05 <monochrom> Some authors assume -Wall, mind you.
19:10:13 <Ariakenom_> the program is the same if you replace them, morally. syntax errors are clearly immoral
19:10:32 <monochrom> In haskell-cafe we just had a small discussion again on whether -Wall should be always on.
19:11:22 <erisco> but deliberation hit a wall
19:11:32 <fuzzypixelz> oh I see, I always forget to turn it on
19:12:09 <boxscape> fuzzypixelz I think the point is that it would complain if you don't use _
19:12:12 <fuzzypixelz> also, "we need to wrap the argument of optional with try because it is a composite parser, not a primitive." What on Earth does this mean? I assume y'all are familiar with megaparsec
19:12:24 <boxscape> i.e. if you just used `m a` instead of `_ <- m a`
19:12:30 <merijn> fuzzypixelz: A simpler question is to disable that specific warning ;)
19:12:47 <solonarv> fuzzypixelz: using _ is another way of explicitly saying "I don't care about this value" (as other people already pointed out)
19:12:53 <merijn> fuzzypixelz: I always use "-Wall -Wno-unused-do-binds", because I personally feel unused-do-binds is a pointless warning
19:13:35 <merijn> fuzzypixelz: *especially* in the context of parser combinators :p
19:13:53 <monochrom> "(a >> b) <|> (a >> c)" for example, if you input makes "a" consume some input and is successful, then that code commits to "a >> b", will not consider "a >> c".
19:14:19 <monochrom> "try (a >> b) <|> (a >> c)" will consider "a >> c".
19:15:08 CitizenSnips joins (~CitizenSn@irc.refl.club)
19:15:18 cheater joins (~user@unaffiliated/cheater)
19:15:44 × glguy quits (x@freenode/staff/haskell.developer.glguy) (Read error: Connection reset by peer)
19:15:49 × star_cloud quits (~star_clou@ec2-34-220-44-120.us-west-2.compute.amazonaws.com) (Ping timeout: 264 seconds)
19:15:55 glguy joins (x@freenode/staff/haskell.developer.glguy)
19:16:10 <monochrom> So parsec and megaparsec kills backtracking whenever a simple criterion is true, but you can opt-in for preserving backtracking with "try".
19:16:32 erisco_ joins (~erisco@104-195-141-253.cpe.teksavvy.com)
19:16:47 <boxscape> fuzzypixels `optional` is defined outside of megaparsec, and if you use it in this context it combines parsers from megaparsec, hence `composite`. Since it's defined outside of megaparsec, megaparsec can't explicitly control its backtracking behavior, so you have to wrap it manually with try
19:17:09 <boxscape> whoops I misspelled your name
19:18:04 × erisco_ quits (~erisco@104-195-141-253.cpe.teksavvy.com) (Client Quit)
19:18:21 erisco_ joins (~erisco@104-195-141-253.cpe.teksavvy.com)
19:18:21 × erisco quits (~erisco@104-195-141-253.cpe.teksavvy.com) (Disconnected by services)
19:18:22 × Jesin quits (~Jesin@pool-72-66-101-18.washdc.fios.verizon.net) (Quit: Leaving)
19:18:38 <boxscape> s/wrap it/wrap its argument
19:18:40 <fuzzypixelz> boxscape: no worries, _It is I_ who misspelled it first ;)
19:18:45 Franciman joins (~francesco@host-82-49-79-73.retail.telecomitalia.it)
19:18:46 <boxscape> heh, fair :)
19:18:51 nyd joins (~nyd@unaffiliated/elysian)
19:19:59 <fuzzypixelz> % optional p = (Just <$> p) <|> pure Nothing
19:19:59 <yahb> fuzzypixelz:
19:20:02 erisco_ is now known as erisco
19:20:14 <fuzzypixelz> This is how the athor defined `optional`
19:20:22 <boxscape> that is also how it's defined in base
19:21:18 knupfer joins (~Thunderbi@200116b82ccd3500b0a727fffee2224e.dip.versatel-1u1.de)
19:21:18 × knupfer quits (~Thunderbi@200116b82ccd3500b0a727fffee2224e.dip.versatel-1u1.de) (Client Quit)
19:21:31 knupfer joins (~Thunderbi@mue-88-130-61-079.dsl.tropolys.de)
19:22:46 × eacameron quits (uid256985@gateway/web/irccloud.com/x-xmnchykalzjujusu) (Quit: Connection closed for inactivity)
19:23:12 bisickcor joins (~username@117.202.60.218)
19:24:47 Jesin joins (~Jesin@pool-72-66-101-18.washdc.fios.verizon.net)
19:25:26 <fuzzypixelz> boxscape: the sentence I posted gives me the impression that there is something wrong with the types, but you're saying that optional just won't be able to backtrack? So if it fails on the first alternative it will just return Nothing and leave?
19:25:50 × pmxb0t quits (~pmxb0t@185.204.1.185) (Remote host closed the connection)
19:25:56 <merijn> boxscape: optional isn't in base, is it?
19:26:05 <merijn> oh, heh, it is
19:26:09 <merijn> When'd that happen
19:26:37 × iekfkk quits (~username@117.200.13.21) (Ping timeout: 264 seconds)
19:26:41 <boxscape> it's one of the few functions where the docs don't say since when it's in base
19:28:14 <fuzzypixelz> boxscape: did I miss anything?
19:28:32 <boxscape> fuzzypixelz I think if you tried something like `optional threeDigitNumber <|> twoDigitNumber`, without wrapping the argument in try, if you ran it on an input like "45", threeDigitNumber would consume both digits and then fail. Then twoDigitNumber would fail, as well, since "45" is already consumed. Whereas if you wrap `threeDigitNumber` in `try`,
19:28:33 <boxscape> `twoDigitNumber` sees the "45" and can parse it
19:29:27 <boxscape> erm
19:29:46 <boxscape> I suppose that should really be something like `optional threeDigitNumber *> twoDigitNumber`
19:30:03 <fuzzypixelz> I get that, but why did he talk about "composite parser" and "primitive"
19:30:27 <fuzzypixelz> https://markkarpov.com/tutorial/megaparsec.html
19:30:48 <boxscape> fuzzypixelz because optional isn't a primitive defined by megaparsec, it's combines the primitives from megaparsec, i.e. pure and <|> and <$>
19:30:51 <geekosaur> because optional is not a parser, it's an external function combining two parsers
19:30:56 <solonarv> a "composite" parser is one that's built by putting together other parsers
19:31:24 × rayyyy quits (~nanoz@gateway/tor-sasl/nanoz) (Quit: Leaving)
19:31:35 <geekosaur> actualmodifies a parser
19:31:43 <geekosaur> guh
19:31:44 <erisco> fuzzypixelz, probably it is a lookahead-1 parser, not backtracking (by default)
19:32:04 <geekosaur> ok, between misspeaking and then my laptop acting up, I'm backing away...
19:33:40 <erisco> there are different notions of what it means to fail
19:33:55 <erisco> it is simpler with general parsers and the notion of failure is the same
19:34:55 <__monty__> Looking at mutable arrays/vectors for the first time. What are the pros/cons of IOVector and STVector?
19:35:44 <solonarv> they are the same (to be precise, STVector = MVector and IOVector = MVector RealWorld)
19:35:46 <merijn> __monty__: You can get "out of" ST, but not IO?
19:35:54 × axeman- quits (~axeman_@2a02:8109:86c0:1f98:b552:2bd4:45ad:9d0e) (Remote host closed the connection)
19:36:10 <boxscape> i.e. you can define something with STVectors inside a pure function
19:36:54 <solonarv> ST is, if you will, an "IO-lite" where you can't mess with the outside world (the only IO-ish thing you can do is mutating previously-allocated mutable data structures, such as STVector, or allocate new ones)
19:37:38 <boxscape> it's IO without input and output? :)
19:37:44 <solonarv> and there is 'runST :: (forall s. ST s a) -> a' which allows you to run ST things inside a pure computation; and it's safe, unlike unsafePerformIO
19:37:49 <merijn> boxscape: And without concurrency
19:37:56 <boxscape> ah, right
19:38:13 <solonarv> and without manual memory management (no pointers), for another example
19:38:20 <__monty__> Hmm, so when would you use IOVector?
19:38:31 <merijn> __monty__: When you're already in IO anyway?
19:38:39 <merijn> __monty__: When you need concurrent updates?
19:38:44 <solonarv> when I want a mutable vector and I'm already in IO, yeah
19:39:03 <__monty__> Ok, TIL. Thank you.
19:40:44 <solonarv> note that up to a newtype wrapper, IO = ST RealWorld, too. The underlying implementation is the same, the difference is in the types and in the API you get
19:41:08 × Vulfe quits (~vulfe@2600:1702:31b0:34e0:a017:afb:342e:7f38) (Remote host closed the connection)
19:41:15 <erisco> you start with ST because you want to be principled, and you end with using IO because you want to get it done
19:41:23 <geekosaur> heh
19:41:37 <solonarv> that's basically how my intcode interpreter started for last year's advent of code :p
19:41:45 Vulfe joins (~vulfe@2600:1702:31b0:34e0:e463:afa6:5cdc:b260)
19:41:45 <merijn> Same ;)
19:41:45 axeman- joins (~axeman_@2a02:8109:86c0:1f98:b552:2bd4:45ad:9d0e)
19:42:13 <solonarv> I went back to State though, rather than plunging into IO
19:42:28 <merijn> I went to IO instead :p
19:42:42 <glguy> I stayed pure
19:42:58 <glguy> made it easy to backtrack on search problems
19:42:59 <merijn> glguy: So did I :)
19:43:51 Vulfe_ joins (~vulfe@2600:1702:31b0:34e0:cb3:d92b:1c86:1704)
19:45:01 jyri-matti joins (uid479350@gateway/web/irccloud.com/x-lridfrkvuwkcrpku)
19:45:01 seaLne1 joins (~seaLne@185.204.1.185)
19:45:48 × Vulfe_ quits (~vulfe@2600:1702:31b0:34e0:cb3:d92b:1c86:1704) (Remote host closed the connection)
19:45:55 Vulfe_ joins (~vulfe@2600:1702:31b0:34e0:cb3:d92b:1c86:1704)
19:46:18 × Vulfe quits (~vulfe@2600:1702:31b0:34e0:e463:afa6:5cdc:b260) (Ping timeout: 260 seconds)
19:47:59 chang joins (~textual@host-173-230-65-85.njjcmar.clients.pavlovmedia.com)
19:48:19 xiinotulp joins (~q@node-ufm.pool-125-24.dynamic.totinternet.net)
19:48:20 <monochrom> I have the opposite view. ST gets IO done, not for principle.
19:48:58 <monochrom> Note that RealWorld is a phantom type and does nothing other than blocking undesirable code re-ordering.
19:49:48 wroathe joins (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net)
19:50:10 <fuzzypixelz> where is void defined?
19:50:34 <Rembane> :i void
19:50:43 <geekosaur> @index void
19:50:43 <lambdabot> Foreign.Marshal.Error, Foreign.Marshal, Foreign, Foreign.Safe, Foreign.Marshal.Safe, Data.Functor, Control.Monad
19:51:22 <fuzzypixelz> oh that's very useful! Google kept showing me Data.Void
19:51:32 <monochrom> Heh, Foreign.Marshal.Error's is IO()->IO() and says "deprecated, use void instead".
19:51:36 sw1nn joins (~sw1nn@2a00:23c6:2385:3a00:9505:a9d7:865a:34e1)
19:51:54 × plutoniix quits (~q@node-uov.pool-125-24.dynamic.totinternet.net) (Ping timeout: 265 seconds)
19:52:20 o1lo01ol1o joins (~o1lo01ol1@bl8-213-81.dsl.telepac.pt)
19:53:05 <boxscape> Control.Monad is the one you want
19:53:34 <boxscape> or I guess Data.Functor, I imagine those are the same?
19:53:53 <erisco> so given two types x:T, y:T there is the type x → y : T
19:54:11 <boxscape> yeah Control.Monad reexports from Data.Functor
19:54:43 <erisco> but also there is a morphism (→) : T × T ↝ T yes? I think I am getting tripped up because these are not distinguished in Haskell
19:55:22 <ADG1089__> It says `instance (LayoutClass l a, LayoutClass r a) => LayoutClass (Choose l r) a` so why can't `x :: l1 ||| l2 ||| l3 ... ||| ln` have type `x :: LayoutClass l a => l a`?
19:55:41 <erisco> so, the morphism → sends the objects x, y to the object x → y
19:57:02 <erisco> and then also confounding is that x → y in this context is not an exponential :P
19:57:56 <erisco> but → could be curried to make an exponential, for example… am I getting this right, category theorists?
20:00:26 × justsomeguy quits (~justsomeg@unaffiliated/--/x-3805311) ()
20:01:11 <merijn> erisco: Why do you think "x → y" is an object?
20:01:26 <erisco> because it is a type, and this is the category of types
20:01:40 <merijn> oh, Haskell as category
20:01:49 <merijn> That's an ill-defined mess
20:02:09 <erisco> that's so immoral
20:02:37 <erisco> I guess I should be saying → is a homset
20:02:45 <boxscape> hm, interesting. split's keepDelimsL and keepDelimsR do the opposite of what I would have expected. I though they would keep the delimiters to the left/right of where they were, but they attach them to the left/right end of adjacent chunks, which is.. the opposite
20:02:55 <erisco> because it is parameterised by objects... it isn't just one morphism
20:03:22 <hseg> wish ghc's pattern match checker could be taught exhaustiveness axioms
20:03:25 × geekosaur quits (42d52137@66.213.33.55) (Ping timeout: 245 seconds)
20:03:40 <hseg> eg that testing /= and == covers everything
20:04:33 <erisco> the time has come where there may be a practical reason to know what they're mummering about, finally
20:04:38 <merijn> hseg: Eh...pretty sure that's considerably harder than that single sentence makes it seem :p
20:04:41 <fuzzypixelz> what is the applicative syntax for `void p`?
20:04:57 × Mikagami quits (~MOSCOS@122.54.107.175) (Remote host closed the connection)
20:05:01 <boxscape> it could be feasible to extend the COMPLETE pragma to allow functions rather than just patterns
20:05:07 mputz joins (~Thunderbi@dslb-088-064-063-125.088.064.pools.vodafone-ip.de)
20:05:09 <hseg> of course. the imagination is remarkably uncreative at finding difficulties for itself
20:05:10 <boxscape> but then again, it might not be
20:05:22 Mikagami joins (~MOSCOS@122.54.107.175)
20:05:38 <merijn> you can already do that via patternsyonyms
20:05:40 <hseg> ... actually, boxscape, that might be a solution here
20:05:52 <monochrom> fuzzypixelz: No change, void p, unless you mean you're looking for *> and <*
20:06:11 <boxscape> merijn can you encode == and /= as pattern synonyms though? last time I tried something similar I failed
20:06:30 <merijn> you can encode view patterns, so yes
20:06:49 <fuzzypixelz> for example I want p = do (,) <$> pWord <*> pWord to parse two words but I need to add a space in between
20:07:53 <monochrom> (,) <$> (pWord <* space) <*> pWord
20:08:05 juuandyy joins (~juuandyy@90.166.144.65)
20:08:12 <monochrom> (,) <$> pWord <*> (space *> pWord)
20:08:13 <__monty__> Hmm, to get an MVector from a list I have to thaw . fromList? I.e., I'm not just blind and there is no MVector.fromList?
20:08:28 <hseg> merijn: how? pattern Eq x y <- ((x,y) -> x == y -> True) ?
20:08:50 <merijn> Something like that
20:08:53 <xerox_> (,) <$> pWord <* space *> pWord -- by symmetry?
20:08:53 <monochrom> You are not blind.
20:09:41 <monochrom> @type \x y -> x <* y *> x
20:09:43 <lambdabot> Applicative f => f b1 -> f b2 -> f b1
20:09:53 <xerox_> drats
20:10:31 × xff0x_ quits (~fox@2001:1a81:53e9:2700:a9f9:6cd7:9a2:daa4) (Ping timeout: 258 seconds)
20:10:46 <monochrom> For real symmetry I would do liftA3 (\x _ z -> (x,z)) pWord space pWord
20:11:11 cosimone joins (~cosimone@2001:b07:ae5:db26:1fb3:ef3f:ece2:c6f8)
20:11:16 <monochrom> Only probably is this doesn't scale when I need liftA10
20:11:23 <monochrom> s/probably/problem/
20:11:25 xff0x_ joins (~fox@2001:1a81:53e9:2700:bff:aece:1b85:7d44)
20:11:42 × o1lo01ol1o quits (~o1lo01ol1@bl8-213-81.dsl.telepac.pt) (Remote host closed the connection)
20:12:55 <erisco> you know what will scale?
20:13:10 <erisco> oh you are making tuples, never mind :P
20:13:23 <monochrom> vectors
20:13:33 <fuzzypixelz> monochrom: `(,) <$> (pWord <* space) <*> pWord` is the same as `(,) <$> (pWord <* space) <*> pWord` no? Someone told me earlier about infixl
20:13:43 <monochrom> vectors scale because a vector space has a "multiply by scalar" operation.
20:13:46 <fuzzypixelz> I mean `(,) <$> pWord <* space <*> pWord`
20:13:49 <erisco> well one reason I made the foldapp package was for this use
20:14:28 <monochrom> I forgot the left/right associativity. But the two are the same after doing a proof using associative laws of <*> etc.
20:14:40 <hololeap> :t \x s y -> (,) <$> x <* s <*> y
20:14:42 <lambdabot> Applicative f => f a1 -> f b -> f a2 -> f (a1, a2)
20:14:44 <erisco> mostly a joke but also because when you're tinkering with parser combinators, changing arity with collecting parse results is annoying
20:15:57 <monochrom> Err, I misread.
20:16:08 <hololeap> :t \s x y z -> (,,) <$> x <* s <*> y <* s <*> z
20:16:11 <lambdabot> Applicative f => f b -> f a1 -> f a2 -> f a3 -> f (a1, a2, a3)
20:16:14 <monochrom> I forgot the left/right associativity, so I put in parentheses to be clear.
20:20:21 <hseg> hrmph. don't see how to make this work that's clearer than case p x of True ->; False;
20:20:35 <hseg> by which point it's esaier to just use an if statement
20:20:52 × hiroaki quits (~hiroaki@ip4d168e73.dynamic.kabel-deutschland.de) (Ping timeout: 246 seconds)
20:20:57 <monochrom> I would use if-then-else, yes. :)
20:21:02 <hseg> except that's not as nice visually as guard patterns
20:21:07 perrier-jouet joins (~perrier-j@modemcable012.251-130-66.mc.videotron.ca)
20:21:26 <hseg> welp
20:21:39 <hseg> pragmatics over aesthetics
20:21:49 <monochrom> Or at least "x==0 = ... | otherwise = ..."
20:21:49 <boxscape> hseg you can always use multiway if instead of if-then-else
20:21:56 <boxscape> or sometimes bool
20:22:10 × dftxbs3e quits (~dftxbs3e@unaffiliated/dftxbs3e) (Remote host closed the connection)
20:23:09 <monochrom> But since there is a raging war over "should you have a catch-all wildcard pattern as your final pattern?", I expect it to carry over to "| otherwise" too.
20:23:31 <hseg> yeah, but multi-way if isn't understood by the exhaustiveness checker
20:24:05 <erisco> I feel like these implicit equivalencies we are used to are the most difficult part for understanding CT
20:24:15 <monochrom> My perspective is much more pragmatic than even exhaustiveness checking. Computing both x==0 and x/=0 is pointless.
20:24:29 <hseg> ... fair
20:24:35 <erisco> it happens again with data constructors, where Just takes a value x and gives you the value Just x
20:25:04 <erisco> but also Just is a value (a function) of type ∀ a. a → Maybe a
20:25:05 <boxscape> monochrom arguably if ghc knew about the exhaustiveness there it could optimize away the x /= 0 call
20:25:10 <hseg> sniped
20:25:24 <erisco> these are different things in category theory but the same to us
20:25:27 <monochrom> | dream
20:25:42 <hololeap> it's not that mentally taxing to remember what the two options for Bool are, so no reason to be explicit with the second choice
20:25:43 <boxscape> might be more complicated when you take into account bottoms though
20:27:06 <boxscape> hm `if | x== 0 -> 1 | x /= 0 -> 2` does in fact have different behavior from `if | x== 0 -> 1 | otherwise -> 2` if x is undefined, I suppose
20:27:13 <boxscape> no
20:27:14 <boxscape> never mind
20:27:17 <monochrom> matching for True, even if it doesn't match, already rules out bottom.
20:27:28 <boxscape> yeah
20:28:23 <monochrom> "x==0" is unlikely to have a different strictness from "x/=0".
20:28:38 <boxscape> yeah true
20:28:45 <monochrom> "x>y" can have a different strictness from "x==y", though.
20:29:53 <monochrom> But only for pathological types such as "let's use unary representation ADT for natural numbers and glorify it as Peano Natural so it sounds profound aesthetic and fundamental"
20:30:43 <monochrom> completely ignoring that even by the low standards of big-O, it takes exponential time and space.
20:31:14 <monochrom> I am not a performance junky, but I am an asymptotic junky.
20:31:43 × wroathe quits (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Ping timeout: 246 seconds)
20:31:45 <__monty__> Could someone help me understand why thaw someVector has type `MVector () (MVector (PrimState (MVector ())) Int)`?
20:32:31 <monochrom> Insufficient context.
20:32:40 <monochrom> I'm pretty sure the explanation is in the context.
20:33:04 <monochrom> For now, thaw has always worked fine for me.
20:33:12 ADG1089_ joins (~aditya@122.163.225.112)
20:33:12 × chang quits (~textual@host-173-230-65-85.njjcmar.clients.pavlovmedia.com) (Quit: My MacBook has gone to sleep. ZZZzzz…)
20:33:36 <solonarv> > Nothing > undefined -- monochrom
20:33:39 <lambdabot> *Exception: Prelude.undefined
20:33:44 <monochrom> I wrote my own random shuffling code, it thaws then shuffles then freezes, works fine.
20:33:49 × ADG1089__ quits (~aditya@122.163.225.112) (Read error: Connection reset by peer)
20:33:53 <solonarv> hm, interesting. That one actually could be non-bottom.
20:34:36 hiroaki joins (~hiroaki@ip4d16fa3b.dynamic.kabel-deutschland.de)
20:35:14 raoulb joins (~weechat@2a02:169:5:a:fd81:f2d9:5f88:bf8b)
20:35:35 geekosaur joins (42d52137@66.213.33.55)
20:35:55 × raoulb quits (~weechat@2a02:169:5:a:fd81:f2d9:5f88:bf8b) (Client Quit)
20:36:01 xcmw joins (~textual@c-76-120-183-86.hsd1.pa.comcast.net)
20:36:39 × juuandyy quits (~juuandyy@90.166.144.65) (Quit: Konversation terminated!)
20:36:58 dftxbs3e joins (~dftxbs3e@unaffiliated/dftxbs3e)
20:38:17 × lkurusa quits (~lkurusa@fedora/Levex) (Quit: leaving)
20:38:22 <fuzzypixelz> :i some
20:38:42 <monochrom> Do you want @index some ?
20:38:42 <Rembane> @info some
20:38:42 <lambdabot> some
20:38:44 <fuzzypixelz> @index some
20:38:44 <lambdabot> Control.Applicative
20:39:01 <monochrom> If you want :info, use yahb.
20:40:29 <fuzzypixelz> Control.Applicative and Text.Megaparsec both import `some` :/
20:40:40 <merijn> The're the same
20:41:18 <monochrom> s/import/export/
20:41:29 <solonarv> actually they might not be
20:41:38 <fuzzypixelz> oh yes but ghc complains about the ambiguous reference
20:41:52 <monochrom> Then hide one of them.
20:41:59 <solonarv> megaparsec reexports a bunch of things from parser-combinators, which has monadic versions of some combinators (including 'some')
20:42:07 <solonarv> % :i Text.Megaparsec.some
20:42:07 <yahb> solonarv: ; <interactive>:1:1: error: Not in scope: `Text.Megaparsec.some'
20:42:11 <solonarv> bah!
20:42:26 <fuzzypixelz> what
20:42:30 <monochrom> % cabal install --lib megaparsec
20:42:30 <yahb> monochrom: ; <interactive>:14:1: error: Variable not in scope: cabal :: t0 -> t; <interactive>:14:7: error: Variable not in scope: install
20:42:50 <fuzzypixelz> isn;t it cabal-install?
20:42:54 <solonarv> % import Text.Megaparsec
20:42:55 <yahb> solonarv: ; <no location info>: error:; Could not find module `Text.Megaparsec'; It is not a module in the current program, or in any known package.
20:43:02 <solonarv> nope not there I guess
20:43:24 <monochrom> ooohhhh....
20:43:27 <fuzzypixelz> I'd better hide the Applicative one?
20:43:28 <monochrom> % :! ls
20:43:29 <yahb> monochrom: A; A.hi; A.hs; A.o; tmp
20:43:34 <solonarv> well, the docs also point this out: https://hackage.haskell.org/package/megaparsec-9.0.1/docs/Text-Megaparsec.html#g:1
20:43:38 <monochrom> % :! cabal --help
20:43:39 <yahb> monochrom: Command line interface to the Haskell Cabal infrastructure.; See http://www.haskell.org/cabal/ for more information.; Usage: cabal [GLOBAL FLAGS] [COMMAND [FLAGS]]; Commands:; [global]; update Updates list of known packages.; install Install packages.; help Help about commands.; info Display detailed information about a particular package.; list
20:43:44 <solonarv> re-exports 'Control.Monad.Combinators'
20:43:54 <solonarv> in there you find: https://hackage.haskell.org/package/parser-combinators-1.2.1/docs/Control-Monad-Combinators.html#v:some
20:43:57 <monochrom> % :! cabal install --lib --dry-run megaparsec
20:43:58 <yahb> monochrom: Warning: Caught exception during _mirrors lookup:res_query: permission denied; (Operation not permitted); Warning: No mirrors found for http://hackage.haskell.org/; dieVerbatim: user error (cabal: Couldn't establish HTTP connection. Possible cause: HTTP proxy server; is down.; )
20:44:06 <__monty__> I have a list, which I want to turn into a mutable vector. Figured I'd use `thaw . fromList` but the types don't line up and I don't understand why. Currently trying `MVector () Int` as the type (because I don't know what to pass for the State parameter).
20:44:08 <xerox_> dieVerbatim
20:44:27 <fuzzypixelz> I just realized something very nasty! I was looking at the megaparsec 4 documentation T_T
20:44:29 <monochrom> That's a relief actually :)
20:44:38 <solonarv> fuzzypixelz: oh, that's also happened to me a few times
20:44:48 <merijn> __monty__: Well, which fromList?
20:45:10 <merijn> __monty__: Oh, wait, did you do this in ghci?
20:45:58 <solonarv> fuzzypixelz: this is a different version of 'some' than the one exported from Control.Applicative; this different version exists because it's more efficient to use with megaparsec's Parsec type
20:46:19 <__monty__> No it's in code. Specifically trying with Data.Vector.Unboxed.thaw/fromList.
20:46:41 <__monty__> I meant compiled code as opposed to GHCi.
20:47:02 × knupfer quits (~Thunderbi@mue-88-130-61-079.dsl.tropolys.de) (Ping timeout: 256 seconds)
20:47:18 <merijn> __monty__: You don't pass anything as state parameter or your vector is useless
20:47:26 <merijn> ST requires a polymorphic state parameter
20:48:15 <solonarv> oh, I think I know what the issue is. something led GHC to infer that you want 'thaw x :: MVector () _'
20:48:21 <fuzzypixelz> from my tutorial "The parser-combinators package provides quite a few abstract combinators built on the concepts of Applicative and Alternative. The Text.Megaparsec module re-exports them from Control.Applicative.Combinators"
20:48:31 <fuzzypixelz> talking about many and some
20:48:35 <merijn> solonarv: No, I just reread and he said he's passing () as state
20:48:40 <solonarv> fuzzypixelz: it is possible for tutorials to be outdated. It looks like this one is.
20:48:47 <solonarv> merijn: that's an additional mistake, yes
20:48:48 <fuzzypixelz> yes!
20:49:05 <fuzzypixelz> https://markkarpov.com/tutorial/megaparsec.html
20:49:17 <fuzzypixelz> last updated September 21, 2020
20:49:22 <solonarv> if you look at the type that's being inferred, GHC is matching 'm ~ MVector ()' (the 'm' from the type of 'thaw')
20:49:59 knupfer joins (~Thunderbi@200116b82ccd3500a4b860c02e178792.dip.versatel-1u1.de)
20:50:07 <solonarv> fuzzypixelz: aha, perhaps that was missed when the author updated their post.
20:50:36 × saep quits (~saep@94.31.86.216) (Remote host closed the connection)
20:50:58 <__monty__> So I can't hide that s in my newtype?
20:51:25 <solonarv> well, you can hide it if you are okay with tying yourself to IO
20:51:29 <solonarv> otherwise, no, you cannot hide it
20:52:11 wroathe joins (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net)
20:53:14 × a3Dman quits (~3Dman@unaffiliated/a3dman) (Quit: Leaving...)
20:54:22 <glguy> It's not a "state" parameter so much as a way to link it back to a particular runST use
20:54:29 a3Dman joins (~3Dman@unaffiliated/a3dman)
20:54:41 <merijn> See also the "Lazy Functional State Threads" paper
20:55:20 × wroathe quits (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Client Quit)
20:56:07 lassulus_ joins (~lassulus@NixOS/user/lassulus)
20:58:25 sand_dull joins (~theuser@c-73-149-95-105.hsd1.ct.comcast.net)
20:59:31 × lassulus quits (~lassulus@NixOS/user/lassulus) (Ping timeout: 268 seconds)
20:59:31 lassulus_ is now known as lassulus
21:02:49 × thc202 quits (~thc202@unaffiliated/thc202) (Quit: thc202)
21:03:30 urek joins (~urek@2804:7f1:e10a:f71b:d9c2:a76e:bc50:3b53)
21:04:53 × urek quits (~urek@2804:7f1:e10a:f71b:d9c2:a76e:bc50:3b53) (Client Quit)
21:05:05 bwe_ is now known as bwe
21:05:12 × bwe quits (~bwe@2a01:4f8:1c1c:4878::2) (Changing host)
21:05:12 bwe joins (~bwe@unaffiliated/bwe)
21:05:26 × sw1nn quits (~sw1nn@2a00:23c6:2385:3a00:9505:a9d7:865a:34e1) (Ping timeout: 264 seconds)
21:07:32 Kronic joins (~Kronic___@84.203.96.46)
21:08:20 wroathe joins (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net)
21:08:58 <Kronic> So, I've a question, I've been wrapping an API I wanna use with Servant and so far the experience has been very good. I am just not sure what to do with the functions I'm exposing. The functions that I have are parameterized by quite a few Maybes (Query parameters) - is there a pattern I can use to deal with this ?
21:09:41 lkurusa joins (~lkurusa@fedora/Levex)
21:11:10 × dandart quits (~Thunderbi@host86-185-55-80.range86-185.btcentralplus.com) (Ping timeout: 256 seconds)
21:12:30 <__monty__> So I want to be using runST rather than execState? Because with the latter I do have to pass an explicit value of type `s` no?
21:13:10 <geekosaur> if you're using STVector then you must use runST, not State
21:13:12 <merijn> __monty__: What
21:13:15 × _ht quits (~quassel@82-169-194-8.biz.kpn.net) (Remote host closed the connection)
21:13:23 <merijn> __monty__: State has 0 to do with ST
21:13:24 <geekosaur> the similarity of names is unfortunate but they're very different things
21:13:38 stef204 joins (~stef204@unaffiliated/stef-204/x-384198)
21:13:58 DirefulSalt joins (DirefulSal@gateway/vpn/privateinternetaccess/direfulsalt)
21:14:11 <monochrom> You can't name them differently because both talk about states.
21:15:37 <monochrom> But programmers have long learned that two unrelated things, or worse, two opposite things, can have the same name, this happens all the time, don't trust names, right? right?
21:17:49 sw1nn joins (~sw1nn@2a00:23c6:2385:3a00:69a4:dccb:26c7:addf)
21:21:55 <__monty__> > :t Data.Vector.thaw (Data.Vector.fromList ([1..3] :: [Int]))
21:21:57 <lambdabot> <hint>:1:1: error: <hint>:1:1: error: parse error on input ‘:’
21:22:03 <__monty__> :t Data.Vector.thaw (Data.Vector.fromList ([1..3] :: [Int]))
21:22:05 <lambdabot> Control.Monad.Primitive.PrimMonad m => m (Data.Vector.Mutable.MVector (Control.Monad.Primitive.PrimState m) Int)
21:22:17 × kam1 quits (~kam1@24.231.108.143) (Ping timeout: 265 seconds)
21:22:19 × bitmagie quits (~Thunderbi@200116b806efa400c8baafc3789c3ca0.dip.versatel-1u1.de) (Quit: bitmagie)
21:22:34 × sand_dull quits (~theuser@c-73-149-95-105.hsd1.ct.comcast.net) (Ping timeout: 256 seconds)
21:23:23 × hnOsmium0001 quits (uid453710@gateway/web/irccloud.com/x-puqqxfwctkhqhqmf) (Quit: Connection closed for inactivity)
21:23:38 × sord937 quits (~sord937@gateway/tor-sasl/sord937) (Quit: sord937)
21:27:44 star_cloud joins (~star_clou@ec2-34-220-44-120.us-west-2.compute.amazonaws.com)
21:28:20 cr3 joins (~cr3@192-222-143-195.qc.cable.ebox.net)
21:30:12 Guest_93 joins (019dd2bc@1.157.210.188)
21:30:27 × Guest_93 quits (019dd2bc@1.157.210.188) (Remote host closed the connection)
21:31:19 <fuzzypixelz> In megaparsec how can say something like manyTill asciiChar (digitChar <|> eof)? Because this doesn't compile, because <|> can't combine parsers of different types apparently
21:31:54 <fuzzypixelz> as in, "just keep consuming ascii chars until you hit a digit or eof"
21:32:08 Lycurgus joins (~niemand@cpe-45-46-137-210.buffalo.res.rr.com)
21:33:03 <fuzzypixelz> I tried "((skipManyTill asciiChar digitChar) <* eof :: Parser Char)" but it still complains about unexpected eof
21:33:14 <__monty__> takewhile1P Nothing isNotDigitOrEol
21:34:07 × xcmw quits (~textual@c-76-120-183-86.hsd1.pa.comcast.net) (Quit: My MacBook has gone to sleep. ZZZzzz…)
21:34:43 × matryoshka quits (~matryoshk@2606:6080:1002:8:3285:30e:de43:8809) (Quit: ZNC 1.8.2 - https://znc.in)
21:34:54 <merijn> fuzzypixelz: Or just find a way to make the types of digitChar and eof the same? :)
21:35:05 matryoshka joins (~matryoshk@184.75.223.227)
21:35:22 <erisco> so there seems to be another notion of "apply" you need… given an object x in the homset domain, and a morphism f from that homset, f x should be an object… but what is this apply called?
21:35:46 <__monty__> I keep running into this type `MVector s (MVector (PrimState (MVector s)) Int)` while what I'm after is `MVector s Int`. What's up with this nested MVector business?
21:36:09 <merijn> __monty__: code or it didn't happen :p
21:36:33 <erisco> right, so if I have an object x, and I have a morphism f from that object, I should be able to refer to the object f is to as f x
21:36:58 <erisco> but this isn't "apply" in the sense of exponentials
21:38:22 kderme joins (2eb0d7c7@ppp046176215199.access.hol.gr)
21:38:31 <__monty__> merijn: http://ix.io/2Jjz
21:38:55 × machinedgod quits (~machinedg@135-23-192-217.cpe.pppoe.ca) (Ping timeout: 246 seconds)
21:39:18 dandart joins (~Thunderbi@2a00:23c7:f5a6:d001:6cf9:1173:9e2a:3c85)
21:39:32 <__monty__> Missing the Megaparsec imports.
21:40:44 × ADG1089_ quits (~aditya@122.163.225.112) (Remote host closed the connection)
21:41:08 ADG1089__ joins (~aditya@122.163.225.112)
21:42:18 <monochrom> "code or it didn't happen" finally
21:42:23 o1lo01ol1o joins (~o1lo01ol1@bl8-213-81.dsl.telepac.pt)
21:45:12 <monochrom> I don't think you should do this inside a parser at all.
21:46:09 <__monty__> I'd like to understand why.
21:46:20 <monochrom> Or rather, if anything, include runST, don't let the Parser monad see ST or PrimState.
21:47:03 <__monty__> include runST in the parser?
21:47:06 × o1lo01ol1o quits (~o1lo01ol1@bl8-213-81.dsl.telepac.pt) (Ping timeout: 256 seconds)
21:47:12 <monochrom> Separation of concerns?
21:47:49 × lassulus quits (~lassulus@NixOS/user/lassulus) (Remote host closed the connection)
21:47:55 <__monty__> So far I've been doing basic data transformation in my parsers. If they can return a list they can return a vector is my thinking.
21:48:23 <monochrom> "Parser (m (Cups (PrimState m)))" says that you are not returning anything remotely close to a vector at all.
21:48:38 × ADG1089__ quits (~aditya@122.163.225.112) (Remote host closed the connection)
21:48:49 <monochrom> It says you are returning, assuming you will do "m = ST s", an ST program that returns a vector.
21:49:16 <monochrom> This is also why you had the XY problem of trying to shoehorn ST s into your newtype.
21:49:39 <__monty__> Parser (Cups s) was my first attempt but doesn't work.
21:49:52 × geekosaur quits (42d52137@66.213.33.55) (Remote host closed the connection)
21:51:00 <monochrom> Because you haven't considered "(\xs -> runST ( (thaw . whatever . freeze) xs)) <$> ... "
21:51:30 <monochrom> err
21:51:49 <monochrom> (\xs -> runST ( (freeze . whatever . thaw) xs)) <$> ...
21:52:37 × MidAutumnHotaru quits (~MidAutumn@154.91.197.93) (Ping timeout: 256 seconds)
21:52:59 <__monty__> But I don't want to freeze the vector? I want to work on the mutable vector after parsing it.
21:53:39 <monochrom> Then you have to level-up to ParserT
21:54:36 MidAutumnHotaru joins (~MidAutumn@154.91.197.93)
21:55:18 lassulus joins (~lassulus@NixOS/user/lassulus)
21:57:23 × takuan quits (~takuan@178-116-218-225.access.telenet.be) (Remote host closed the connection)
21:57:43 <merijn> and just use IO :p
21:58:18 <merijn> __monty__: You wanna just parse and return a immutable vector and thaw that in the end/where you start using it
21:58:36 × L29Ah quits (~L29Ah@unaffiliated/l29ah) (Ping timeout: 240 seconds)
21:58:42 <merijn> Trying to have it thawed from the start is a recipe for pain like "can't store it in anything without parameterising over 's'"
21:59:14 <monochrom> I would do that. Separation of concerns.
21:59:29 <monochrom> But one can always refute "you don't know the actual AoC problem".
22:00:50 <monochrom> In fact, the parser return a vanilla list. Change over to mutable vector later.
22:01:30 <__monty__> I'm trying to figure out `thaw <$> (whatever :: Parsed (Vector Int))` but running similar type errors involving PrimState.
22:01:33 <__monty__> *into
22:02:02 <monochrom> The type error is genuine. Wrong monad.
22:02:47 ulidtko|k joins (~ulidtko@193.111.48.79)
22:03:40 × rprije quits (~rprije@202.168.43.92) (Remote host closed the connection)
22:03:46 × erisco quits (~erisco@104-195-141-253.cpe.teksavvy.com) (Ping timeout: 246 seconds)
22:05:00 <__monty__> How do I turn a list into a mutable vector to be used in a function MVector s Int -> MVector s Int?
22:05:08 × sw1nn quits (~sw1nn@2a00:23c6:2385:3a00:69a4:dccb:26c7:addf) (Ping timeout: 258 seconds)
22:05:57 × ulidtko quits (~ulidtko@194.54.80.38) (Ping timeout: 272 seconds)
22:06:01 L29Ah joins (~L29Ah@unaffiliated/l29ah)
22:07:23 <merijn> __monty__: PrimState require's an 'm' that is PrimMonad
22:07:32 <merijn> __monty__: Parsed (presumably) is not
22:07:51 <merijn> Since the only default PrimMonad are IO/ST s and transformers over those
22:09:05 × abitibien quits (~abitibien@51.194.80.91) (Ping timeout: 240 seconds)
22:09:43 <merijn> Anyway, I still recommend reading the "Lazy Functional State Threads" paper I mentioned a while back
22:10:32 <merijn> Or simpler, just parse a frozen Vector and only thaw it when you're gonna do something with it
22:10:39 × bandali quits (bandali@fsf/interns/bandali) (Changing host)
22:10:39 bandali joins (bandali@fsf/emeritus/bandali)
22:10:47 <merijn> Vectors, like food, are easier kept and transported when frozen
22:10:48 <fuzzypixelz> I freaking love functional parsing
22:11:15 <__monty__> I'm trying to get the absolute minimum knowledge I need to use MVector. Do I really need to read a paper for this?
22:11:19 × Mikagami quits (~MOSCOS@122.54.107.175) (Read error: Connection reset by peer)
22:11:23 <__monty__> I am parsing a regular vector now though.
22:11:33 <monochrom> <merijn> Or simpler, just parse a frozen Vector and only thaw it when you're gonna do something with it
22:11:42 <__monty__> Hence trying to fmap thaw into the Either.
22:11:43 Mikagami joins (~MOSCOS@122.54.107.175)
22:11:55 <__monty__> So I can then call the function that wants an MVector.
22:12:10 <merijn> __monty__: thaw doesn't give you an MVector
22:12:18 <merijn> It gives you an *action* that returns an MVector
22:12:58 <monochrom> Don't even fmap into the Either, until after you understand the elementary solution: just use pattern matching on Left and Right.
22:13:39 <merijn> __monty__: See my solution for last year: https://github.com/merijn/AdventOfCode2019/blob/master/Day2.hs
22:13:58 <merijn> You don't thaw until the moment you start actually running something mutable
22:14:10 <merijn> Because 1) it just makes your life difficult and 2) it has no benefits
22:14:35 notzmv joins (~user@unaffiliated/zmv)
22:14:54 <monochrom> And you slap your runST on to the smallest minimal scope possible.
22:15:45 fradet joins (~pi@216.252.75.247)
22:16:18 son0p joins (~son0p@181.136.122.143)
22:16:43 × fradet quits (~pi@216.252.75.247) (Client Quit)
22:17:26 Deide joins (~Deide@217.155.19.23)
22:17:42 × nyd quits (~nyd@unaffiliated/elysian) (Ping timeout: 260 seconds)
22:17:54 sw1nn joins (~sw1nn@2a00:23c6:2385:3a00:70f5:3f58:1132:aff0)
22:18:21 fradet joins (~pi@216.252.75.247)
22:20:58 <fuzzypixelz> up until now I've been using parseTest inside GHCi, now what?
22:21:21 <merijn> Anyway, night!
22:21:34 <fuzzypixelz> do I just use bind to get the tokens?
22:24:24 iekfkk joins (~username@117.200.2.100)
22:26:44 × merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 260 seconds)
22:27:37 × bisickcor quits (~username@117.202.60.218) (Ping timeout: 260 seconds)
22:34:47 × neiluj quits (~jco@91-167-203-101.subs.proxad.net) (Ping timeout: 265 seconds)
22:35:37 × Franciman quits (~francesco@host-82-49-79-73.retail.telecomitalia.it) (Quit: Leaving)
22:41:17 xcmw joins (~textual@2601:541:4404:bb5c:e16e:dd8f:7929:2608)
22:42:44 × knupfer quits (~Thunderbi@200116b82ccd3500a4b860c02e178792.dip.versatel-1u1.de) (Quit: knupfer)
22:42:53 knupfer joins (~Thunderbi@200116b82ccd3500f45b060487e69f4e.dip.versatel-1u1.de)
22:43:27 machinedgod joins (~machinedg@24.105.81.50)
22:43:49 <solonarv> you use 'parse', or 'parseMaybe' if you don't care about the error message
22:43:58 bitmagie joins (~Thunderbi@200116b806efa4000d3e16972e0f16a6.dip.versatel-1u1.de)
22:44:21 × elfets quits (~elfets@ip-37-201-23-96.hsi13.unitymediagroup.de) (Quit: Leaving)
22:45:34 coot joins (~coot@37.30.50.187.nat.umts.dynamic.t-mobile.pl)
22:46:00 hackage algebraic-graphs-io 0.1.5.0 - I/O utilities for algebraic-graphs https://hackage.haskell.org/package/algebraic-graphs-io-0.1.5.0 (ocramz)
22:46:10 × matryoshka quits (~matryoshk@184.75.223.227) (Quit: ZNC 1.8.2 - https://znc.in)
22:46:29 matryoshka joins (~matryoshk@2606:6080:1002:8:3285:30e:de43:8809)
22:48:10 × mputz quits (~Thunderbi@dslb-088-064-063-125.088.064.pools.vodafone-ip.de) (Quit: mputz)
22:53:43 × vs^ quits (vs@ip98-184-89-2.mc.at.cox.net) ()
22:54:33 recursion_ninja joins (ad4dccaf@pool-173-77-204-175.nycmny.fios.verizon.net)
22:54:41 × Synthetica quits (uid199651@gateway/web/irccloud.com/x-arxbcjhlstycoeub) (Quit: Connection closed for inactivity)
22:56:26 <recursion_ninja> Hey, I'm trying to build my Haskell project by running "cabal install" but I get the error message "ghc: no input files." Funnily, "cabal build" works perfectly fine. Does anyone have any idea how to debug this... less than informative error message? My project is pretty complicated so I'm just looking for pointers for isolating the issue.
22:56:30 merijn joins (~merijn@83-160-49-249.ip.xs4all.nl)
22:57:53 royal_screwup21 joins (52254809@gateway/web/cgi-irc/kiwiirc.com/ip.82.37.72.9)
22:59:02 <shapr> Is there a good name for foo :: [a -> b] -> a -> [b] ?
23:00:23 <glguy> recursion_ninja, what does 'cabal --version' report?
23:00:40 <hpc> shapr: at one point in lambdabot's L.hs, it was flip
23:00:51 <shapr> hpc: ok, thanks
23:01:31 × merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 246 seconds)
23:01:42 <shapr> I thought flip was already used for (a -> b -> c) -> b -> a -> c
23:02:28 × royal_screwup21 quits (52254809@gateway/web/cgi-irc/kiwiirc.com/ip.82.37.72.9) (Ping timeout: 256 seconds)
23:05:19 × sw1nn quits (~sw1nn@2a00:23c6:2385:3a00:70f5:3f58:1132:aff0) (Ping timeout: 258 seconds)
23:05:26 <solonarv> :t \fs x -> ($x) <$> f
23:05:28 <lambdabot> (Functor f, FromExpr (f (a -> b))) => p -> a -> f b
23:05:32 <solonarv> oops
23:05:34 <solonarv> :t \fs x -> ($x) <$> fs
23:05:35 <lambdabot> Functor f => f (a -> b) -> a -> f b
23:06:03 <solonarv> choose f ~ [] and you get what shapr asked about. Choose f ~ ((->) e) and you get flip.
23:06:24 × tromp quits (~tromp@dhcp-077-249-230-040.chello.nl) ()
23:06:46 × cr3 quits (~cr3@192-222-143-195.qc.cable.ebox.net) (Ping timeout: 246 seconds)
23:06:48 kam1 joins (~kam1@24.231.108.143)
23:07:20 <recursion_ninja> glguy: 3.4.0.0
23:07:28 <shapr> solonarv: so the (??) from lens is more general
23:07:40 <shapr> :t (??)
23:07:42 <lambdabot> Functor f => f (a -> b) -> a -> f b
23:07:45 <recursion_ninja> glguy: cabal-install version 3.4.0.0
23:10:10 <solonarv> shapr: yup, looks like it
23:10:29 hackage algebraic-graphs-io 0.1.5.1 - I/O utilities and datasets for algebraic-graphs https://hackage.haskell.org/package/algebraic-graphs-io-0.1.5.1 (ocramz)
23:11:11 tsrt^ joins (tsrt@ip98-184-89-2.mc.at.cox.net)
23:11:29 × knupfer quits (~Thunderbi@200116b82ccd3500f45b060487e69f4e.dip.versatel-1u1.de) (Ping timeout: 268 seconds)
23:17:36 <glguy> recursion_ninja, I'm not sure, but you might try building with --verbose to see if anything looking unusual
23:17:48 Kerberos88 joins (~Kerberos8@185.44.144.78)
23:17:58 sw1nn joins (~sw1nn@2a00:23c6:2385:3a00:ad7a:1249:54d6:c8ee)
23:18:04 <Kerberos88> how does haskell have so many users?
23:18:33 <Rembane> Sheer luck
23:19:44 <recursion_ninja> glguy: Thanks, I'll give that a try.
23:21:50 mputz joins (~Thunderbi@dslb-088-064-063-125.088.064.pools.vodafone-ip.de)
23:21:52 albion3 joins (~albion3@51.194.80.91)
23:22:01 × mputz quits (~Thunderbi@dslb-088-064-063-125.088.064.pools.vodafone-ip.de) (Client Quit)
23:22:32 × philopsos quits (~caecilius@gateway/tor-sasl/caecilius) (Quit: Lost terminal)
23:23:11 × coot quits (~coot@37.30.50.187.nat.umts.dynamic.t-mobile.pl) (Quit: coot)
23:24:19 usr25 joins (~J@80.red-79-151-174.dynamicip.rima-tde.net)
23:24:53 tromp joins (~tromp@dhcp-077-249-230-040.chello.nl)
23:24:54 × axeman- quits (~axeman_@2a02:8109:86c0:1f98:b552:2bd4:45ad:9d0e) (Remote host closed the connection)
23:24:58 × fendor_ quits (~fendor@178.165.130.229.wireless.dyn.drei.com) (Ping timeout: 246 seconds)
23:25:30 hackage HSmarty 0.4.1 - Small template engine https://hackage.haskell.org/package/HSmarty-0.4.1 (AlexanderThiemann)
23:25:58 × tromp quits (~tromp@dhcp-077-249-230-040.chello.nl) (Remote host closed the connection)
23:26:39 tromp joins (~tromp@dhcp-077-249-230-040.chello.nl)
23:27:25 × Kerberos88 quits (~Kerberos8@185.44.144.78) (Remote host closed the connection)
23:27:28 gabrielbezerra joins (~androirc@109-226-150-83.cable.swschwedt.net)
23:27:33 × kritzefitz quits (~kritzefit@212.86.56.80) (Remote host closed the connection)
23:28:08 × heatsink quits (~heatsink@2600:1700:bef1:5e10:19ea:e852:616:ff9f) (Remote host closed the connection)
23:28:43 × son0p quits (~son0p@181.136.122.143) (Quit: Lost terminal)
23:31:05 o1lo01ol1o joins (~o1lo01ol1@bl8-213-81.dsl.telepac.pt)
23:31:48 justanotheruser joins (~justanoth@unaffiliated/justanotheruser)
23:33:20 gabrielbezerra parts (~androirc@109-226-150-83.cable.swschwedt.net) ("Trennungsnachricht")
23:33:24 merijn joins (~merijn@83-160-49-249.ip.xs4all.nl)
23:35:37 × o1lo01ol1o quits (~o1lo01ol1@bl8-213-81.dsl.telepac.pt) (Ping timeout: 264 seconds)
23:35:57 seiryn joins (~seiryn@2a01cb0409c990003ccf6635f6976a70.ipv6.abo.wanadoo.fr)
23:37:00 × kupi quits (uid212005@gateway/web/irccloud.com/x-ejbvangncrpxemxc) (Quit: Connection closed for inactivity)
23:39:56 ishutin_ joins (~Ishutin@92-249-150-129.static.digikabel.hu)
23:40:53 × kderme quits (2eb0d7c7@ppp046176215199.access.hol.gr) (Remote host closed the connection)
23:41:02 × bitmagie quits (~Thunderbi@200116b806efa4000d3e16972e0f16a6.dip.versatel-1u1.de) (Quit: bitmagie)
23:41:07 × tromp quits (~tromp@dhcp-077-249-230-040.chello.nl) (Remote host closed the connection)
23:43:08 × boxscape quits (4ff0ba59@gateway/web/cgi-irc/kiwiirc.com/ip.79.240.186.89) (Quit: Connection closed)
23:43:33 × ishutin quits (~Ishutin@178-164-206-88.pool.digikabel.hu) (Ping timeout: 268 seconds)
23:44:12 pavonia joins (~user@unaffiliated/siracusa)
23:44:17 × mimi_vx quits (~mimi@2a01:490:16:1026:81e9:63f1:91e1:9716) (Quit: WeeChat 3.0)
23:44:26 × seiryn quits (~seiryn@2a01cb0409c990003ccf6635f6976a70.ipv6.abo.wanadoo.fr) (Quit: WeeChat 3.0)
23:44:45 seiryn joins (~seiryn@2a01cb0409c990003ccf6635f6976a70.ipv6.abo.wanadoo.fr)
23:44:59 × xcmw quits (~textual@2601:541:4404:bb5c:e16e:dd8f:7929:2608) (Quit: My MacBook has gone to sleep. ZZZzzz…)
23:45:35 axeman- joins (~axeman_@2a02:8109:86c0:1f98:b552:2bd4:45ad:9d0e)
23:45:57 kderme joins (2eb0d7c7@ppp046176215199.access.hol.gr)
23:50:27 × axeman- quits (~axeman_@2a02:8109:86c0:1f98:b552:2bd4:45ad:9d0e) (Ping timeout: 272 seconds)
23:51:47 × mounty quits (~mounty@210.1.196.133) (Quit: Konversation terminated!)
23:57:50 <fuzzypixelz> instead of a `Parser a`, I want to write a `Parser (Maybe a)` depending on whether or not the first parser failed or not, using megaparsec
23:58:17 <fuzzypixelz> so if my parser `p` fails, I'd like a Parser Nothing
23:58:20 × kam1 quits (~kam1@24.231.108.143) (Ping timeout: 256 seconds)
23:58:41 <fuzzypixelz> but if it succeeds and matches s, I'd like a Parser (Just s)
23:58:48 heatsink joins (~heatsink@2600:1700:bef1:5e10:19ea:e852:616:ff9f)
23:59:19 <fuzzypixelz> is there a wrapper for this? If not, can you please show me an example? My Haskell knowledge is very shaky
23:59:37 × hiroaki quits (~hiroaki@ip4d16fa3b.dynamic.kabel-deutschland.de) (Ping timeout: 246 seconds)

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