Home liberachat/#haskell: Logs Calendar

Logs on 2022-02-06 (liberachat/#haskell)

00:00:05 <geekosaur> and there's even an example usage of doctest which uses -i that way (toward the end of https://hackage.haskell.org/package/doctest readme)
00:02:35 <hololeap> geekosaur: oh, thanks. interesting that the github readme doesn't include that
00:03:15 <geekosaur> which github readme? I pulled it from doctest's, since it's running doctest as a function instead of a program
00:03:34 <geekosaur> shortly above "Doctest in the wild"
00:04:02 <hololeap> https://github.com/sol/doctest#readme
00:04:22 <hololeap> I just did a CTRL+F search for "-i" and didn't see anything that looked relevant
00:07:40 tromp joins (~textual@dhcp-077-249-230-040.chello.nl)
00:09:27 <geekosaur> interesting. yep, looks like thta whole subsection is missing from the github readme
00:10:20 × tromp quits (~textual@dhcp-077-249-230-040.chello.nl) (Client Quit)
00:14:34 bontaq joins (~user@ool-45779fe5.dyn.optonline.net)
00:16:17 machinedgod joins (~machinedg@24.105.81.50)
00:20:11 chexum joins (~quassel@gateway/tor-sasl/chexum)
00:23:45 chenqisu1 joins (~chenqisu1@183.217.200.249)
00:28:19 kaph joins (~kaph@net-2-47-208-144.cust.vodafonedsl.it)
00:29:19 × Tuplanolla quits (~Tuplanoll@91-159-68-166.elisa-laajakaista.fi) (Quit: Leaving.)
00:40:20 unyu joins (~pyon@user/pyon)
00:46:07 × eggplantade quits (~Eggplanta@2600:1700:bef1:5e10:c18f:7483:538b:1622) (Remote host closed the connection)
00:57:24 <Inst[m]> btw
00:57:28 <Inst[m]> if anyone wants to see how bizarre my current winio behavior is:
00:57:29 <Inst[m]> https://pastebin.com/8G6WD6MU
00:58:41 <geekosaur> that's multiple ghci-s running in the same terminal
00:58:56 <geekosaur> not supposed to happen these days, but…
00:59:44 <geekosaur> check the taks manager and kill all ghci or ghc processes you find running, then try again
00:59:48 <geekosaur> *task
01:01:51 × jao quits (~jao@cpc103048-sgyl39-2-0-cust502.18-2.cable.virginm.net) (Ping timeout: 256 seconds)
01:03:39 jao joins (~jao@68.235.43.173)
01:05:14 <Inst[m]> yeah, i know
01:05:15 <Inst[m]> it's insane
01:06:02 × burnsidesLlama quits (~burnsides@dhcp168-015.wadham.ox.ac.uk) (Remote host closed the connection)
01:06:34 burnsidesLlama joins (~burnsides@client-8-65.eduroam.oxuni.org.uk)
01:07:03 × etale quits (~user@2600:8802:2105:7100:721c:e7ff:feda:ed41) (Quit: ERC (IRC client for Emacs 27.1))
01:10:34 × pretty_dumm_guy quits (trottel@gateway/vpn/protonvpn/prettydummguy/x-88029655) (Quit: WeeChat 3.4)
01:10:55 × burnsidesLlama quits (~burnsides@client-8-65.eduroam.oxuni.org.uk) (Ping timeout: 256 seconds)
01:11:13 × albet70 quits (~xxx@2400:8902::f03c:92ff:fe60:98d8) (Remote host closed the connection)
01:14:18 romesrf joins (~romes@2001:8a0:dd9e:2c00:fd1b:fa:a17:a972)
01:14:29 <romesrf> o/
01:17:20 albet70 joins (~xxx@2400:8902::f03c:92ff:fe60:98d8)
01:18:56 etale joins (~user@2600:8802:2105:7100:721c:e7ff:feda:ed41)
01:19:15 etale parts (~user@2600:8802:2105:7100:721c:e7ff:feda:ed41) ()
01:20:38 etale joins (~user@2600:8802:2105:7100:721c:e7ff:feda:ed41)
01:21:01 etale parts (~user@2600:8802:2105:7100:721c:e7ff:feda:ed41) ()
01:22:03 eggplantade joins (~Eggplanta@2600:1700:bef1:5e10:c18f:7483:538b:1622)
01:28:37 × romesrf quits (~romes@2001:8a0:dd9e:2c00:fd1b:fa:a17:a972) (Ping timeout: 240 seconds)
01:33:12 merijn joins (~merijn@c-001-001-018.client.esciencecenter.eduvpn.nl)
01:36:06 × jonathanx_ quits (~jonathan@h-178-174-176-109.A357.priv.bahnhof.se) (Remote host closed the connection)
01:36:23 jonathanx_ joins (~jonathan@h-178-174-176-109.A357.priv.bahnhof.se)
01:58:25 ellie joins (~ellie@user/ellie)
02:02:31 × xsperry quits (~xs@user/xsperry) (Remote host closed the connection)
02:05:06 × jonathanx_ quits (~jonathan@h-178-174-176-109.A357.priv.bahnhof.se) (Remote host closed the connection)
02:05:24 jonathanx_ joins (~jonathan@h-178-174-176-109.a357.priv.bahnhof.se)
02:05:40 × leungbk quits (~brian@cpe-142-129-149-172.socal.res.rr.com) (Quit: Lost terminal)
02:07:01 × merijn quits (~merijn@c-001-001-018.client.esciencecenter.eduvpn.nl) (Ping timeout: 256 seconds)
02:14:37 × vglfr quits (~vglfr@coupling.penchant.volia.net) (Ping timeout: 256 seconds)
02:17:35 califax- joins (~califax@user/califx)
02:18:11 vglfr joins (~vglfr@coupling.penchant.volia.net)
02:21:09 × califax quits (~califax@user/califx) (Ping timeout: 276 seconds)
02:21:09 califax- is now known as califax
02:26:51 × waleee quits (~waleee@2001:9b0:21d:fc00:398f:b003:b90d:acf4) (Ping timeout: 256 seconds)
02:27:28 × jao quits (~jao@68.235.43.173) (Remote host closed the connection)
02:28:40 d34df00d joins (~d34df00d@2600:1700:8c60:3a10::48)
02:28:55 <d34df00d> Hi!
02:29:01 <d34df00d> Exceptions question!
02:29:54 <d34df00d> Supose I write a server thread that `forever` reads a line from a socket and does something with it. If the line fails to be read, or if the handler throws an exception, I want to log it, ignore it and run the handler on the next lines.
02:30:22 <d34df00d> But I don't want to ignore things I shouldn't ignore, like killing the thread.
02:30:40 <d34df00d> How to write this "ignore any exception except the ones that shouldn't be ignored"?
02:31:43 <d34df00d> What comes to mind is having more specific handlers for AsyncException/SomeAsyncException which rethrow, and log/ignore the rest.
02:32:45 × mmhat quits (~mmh@55d44844.access.ecotel.net) (Ping timeout: 256 seconds)
02:33:07 rusrushal13 joins (~rusrushal@2409:4056:108:9c3b:d7fd:94d2:1ba2:efdd)
02:33:21 <d34df00d> But I'm not sure if that's right.
02:36:17 × xff0x quits (~xff0x@2001:1a81:525e:1300:8c6b:7d96:3a83:c2cd) (Ping timeout: 240 seconds)
02:36:18 <ski> d34df00d : maybe define your own kind of exception, and catch only that ?
02:37:00 <d34df00d> ski: I want to also be able to catch whatever non-total Prelude functions throw, or maybe some arbitrary third-party library throws.
02:37:19 <ski> (or if you can quantify exactly which exceptions you want to catch, do that)
02:38:04 <d34df00d> I don't really know in advance.
02:38:17 xff0x joins (~xff0x@2001:1a81:52c7:8c00:1f7f:998e:5249:4548)
02:38:22 <d34df00d> Think of it as really "a catch-all exception handler at the top of a server loop".
02:38:45 × Erutuon quits (~Erutuon@user/erutuon) (Ping timeout: 256 seconds)
02:39:35 <ski> @wiki Error vs. Exception
02:39:35 <lambdabot> https://wiki.haskell.org/Error_vs._Exception
02:39:57 × alp quits (~alp@user/alp) (Ping timeout: 240 seconds)
02:40:07 <ski> @hoogle catchJust
02:40:07 <lambdabot> Control.Exception catchJust :: Exception e => (e -> Maybe b) -> IO a -> (b -> IO a) -> IO a
02:40:07 <lambdabot> Control.Exception.Base catchJust :: Exception e => (e -> Maybe b) -> IO a -> (b -> IO a) -> IO a
02:40:07 <lambdabot> Control.Monad.Catch catchJust :: (MonadCatch m, Exception e) => (e -> Maybe b) -> m a -> (b -> m a) -> m a
02:40:24 <ski> if you know which exceptions you don't want to catch, you could opt out of those, using ^
02:41:29 × raehik quits (~raehik@cpc95906-rdng25-2-0-cust156.15-3.cable.virginm.net) (Ping timeout: 256 seconds)
02:41:30 <d34df00d> That makes sense. What things I don't want to catch, though? I know about AsyncException, but is there anything else?
02:42:57 × wombat875 quits (~wombat875@pool-72-89-24-154.nycmny.fios.verizon.net) (Ping timeout: 256 seconds)
02:44:12 × x_kuru quits (~xkuru@user/xkuru) (Read error: Connection reset by peer)
02:45:02 wombat875 joins (~wombat875@pool-72-89-24-154.nycmny.fios.verizon.net)
02:52:29 × harveypwca quits (~harveypwc@2601:246:c180:a570:3828:d8:e523:3f67) (Quit: Leaving)
02:58:50 xsperry joins (~xs@user/xsperry)
03:01:34 lavaman joins (~lavaman@98.38.249.169)
03:02:14 <jackdk> better to catch only the things you know you want. The easiest way to do this is to never write anything that throws, and propagate your errors with constructs like ExceptT. If you use library functions that can throw, immediately wrap the exceptions you care about into Either or Maybe
03:03:55 × machinedgod quits (~machinedg@24.105.81.50) (Ping timeout: 256 seconds)
03:05:37 × [itchyjunk] quits (~itchyjunk@user/itchyjunk/x-7353470) (Ping timeout: 256 seconds)
03:06:11 × lavaman quits (~lavaman@98.38.249.169) (Ping timeout: 256 seconds)
03:06:59 × cuz` quits (~user@50.226.229.246) (Ping timeout: 256 seconds)
03:09:34 [itchyjunk] joins (~itchyjunk@user/itchyjunk/x-7353470)
03:09:36 × jonathanx_ quits (~jonathan@h-178-174-176-109.a357.priv.bahnhof.se) (Remote host closed the connection)
03:09:53 jonathanx_ joins (~jonathan@h-178-174-176-109.A357.priv.bahnhof.se)
03:10:32 oscurochu joins (~oscurochu@097-096-050-227.res.spectrum.com)
03:10:44 dajoer joins (~david@user/gvx)
03:10:46 × rusrushal13 quits (~rusrushal@2409:4056:108:9c3b:d7fd:94d2:1ba2:efdd) (Quit: Client closed)
03:16:45 Inst joins (~delicacie@2601:6c4:4080:3f80:9d25:f887:d801:3464)
03:17:14 <Inst> btw
03:17:34 <Inst> who was asking about N+k patterns?
03:17:58 <Inst> it's still doable, just do nested function definitions, i.e, you use a where pattern
03:18:11 <Inst> but i think it was already discussed the last time
03:18:41 <Inst> fun (n+k) = .... is now fun n = iFun (n+k) where iFun = ....
03:23:59 × rembo10 quits (~rembo10@remulis.com) (Quit: ZNC 1.8.2 - https://znc.in)
03:24:53 rembo10 joins (~rembo10@remulis.com)
03:25:17 × wroathe quits (~wroathe@user/wroathe) (Ping timeout: 240 seconds)
03:25:37 k8yun joins (~k8yun@198-48-158-40.cpe.pppoe.ca)
03:25:51 wroathe joins (~wroathe@206-55-188-8.fttp.usinternet.com)
03:25:51 × wroathe quits (~wroathe@206-55-188-8.fttp.usinternet.com) (Changing host)
03:25:51 wroathe joins (~wroathe@user/wroathe)
03:26:35 × chenqisu1 quits (~chenqisu1@183.217.200.249) (Ping timeout: 256 seconds)
03:35:09 × geekosaur quits (~geekosaur@xmonad/geekosaur) (Killed (NickServ (GHOST command used by allbery_b)))
03:35:10 allbery_b joins (~geekosaur@xmonad/geekosaur)
03:35:13 allbery_b is now known as geekosaur
03:35:55 × ProfSimm quits (~ProfSimm@87.227.196.109) (Remote host closed the connection)
03:37:16 jao joins (~jao@68.235.43.173)
03:37:35 × wroathe quits (~wroathe@user/wroathe) (Ping timeout: 256 seconds)
03:37:52 × pie_ quits (~pie_bnc@user/pie/x-2818909) (Quit: pie_)
03:39:37 × td_ quits (~td@muedsl-82-207-238-241.citykom.de) (Ping timeout: 256 seconds)
03:41:28 pie_ joins (~pie_bnc@user/pie/x-2818909)
03:41:33 td_ joins (~td@muedsl-82-207-238-099.citykom.de)
03:41:37 × Inst quits (~delicacie@2601:6c4:4080:3f80:9d25:f887:d801:3464) (Ping timeout: 240 seconds)
03:43:09 <ski> Inst[m] : that's, almost, the opposite
03:44:01 <ski> (almost, because an n+k pattern only matches non-negatives)
03:44:38 cuz` joins (~user@50.226.229.246)
03:49:15 × cuz` quits (~user@50.226.229.246) (Ping timeout: 256 seconds)
03:52:11 × jonathanx_ quits (~jonathan@h-178-174-176-109.A357.priv.bahnhof.se) (Remote host closed the connection)
03:52:27 jonathanx_ joins (~jonathan@h-178-174-176-109.A357.priv.bahnhof.se)
03:54:41 × mon_aaraj quits (~MonAaraj@user/mon-aaraj/x-4416475) (Ping timeout: 256 seconds)
03:56:50 mon_aaraj joins (~MonAaraj@user/mon-aaraj/x-4416475)
04:03:08 dyeplexer joins (~dyeplexer@user/dyeplexer)
04:03:55 merijn joins (~merijn@c-001-001-018.client.esciencecenter.eduvpn.nl)
04:17:34 Inst joins (~delicacie@2601:6c4:4080:3f80:65d0:53d1:d25a:5705)
04:23:57 × mon_aaraj quits (~MonAaraj@user/mon-aaraj/x-4416475) (Ping timeout: 240 seconds)
04:26:10 mon_aaraj joins (~MonAaraj@user/mon-aaraj/x-4416475)
04:27:11 fef joins (~thedawn@user/thedawn)
04:29:46 × bontaq quits (~user@ool-45779fe5.dyn.optonline.net) (Ping timeout: 250 seconds)
04:37:59 × merijn quits (~merijn@c-001-001-018.client.esciencecenter.eduvpn.nl) (Ping timeout: 256 seconds)
04:42:43 Akiva joins (~Akiva@user/Akiva)
04:42:58 Erutuon joins (~Erutuon@user/erutuon)
04:46:48 deadmarshal joins (~deadmarsh@95.38.114.160)
04:49:17 LiaoTao_ joins (~LiaoTao@gateway/tor-sasl/liaotao)
04:49:21 × LiaoTao quits (~LiaoTao@gateway/tor-sasl/liaotao) (Ping timeout: 276 seconds)
04:49:45 × [itchyjunk] quits (~itchyjunk@user/itchyjunk/x-7353470) (Remote host closed the connection)
04:50:48 × Sgeo quits (~Sgeo@user/sgeo) (Read error: Connection reset by peer)
04:55:57 × emf quits (~emf@2620:10d:c090:400::5:ab3f) (Ping timeout: 240 seconds)
04:57:36 emf joins (~emf@2620:10d:c090:400::5:ab3f)
04:58:28 gaff joins (~gaff@49.207.221.138)
05:02:28 Sgeo joins (~Sgeo@user/sgeo)
05:05:36 × ec quits (~ec@gateway/tor-sasl/ec) (Ping timeout: 276 seconds)
05:10:22 wroathe joins (~wroathe@206-55-188-8.fttp.usinternet.com)
05:10:22 × wroathe quits (~wroathe@206-55-188-8.fttp.usinternet.com) (Changing host)
05:10:22 wroathe joins (~wroathe@user/wroathe)
05:13:41 × jao quits (~jao@68.235.43.173) (Ping timeout: 256 seconds)
05:25:01 × wroathe quits (~wroathe@user/wroathe) (Ping timeout: 256 seconds)
05:30:49 ld86 joins (~ld86@host86-151-221-50.range86-151.btcentralplus.com)
05:31:02 × szkl quits (uid110435@id-110435.uxbridge.irccloud.com) (Quit: Connection closed for inactivity)
05:32:22 × ld86 quits (~ld86@host86-151-221-50.range86-151.btcentralplus.com) (Client Quit)
05:34:41 meer joins (~delicacie@2601:6c4:4080:3f80:99ec:65c9:5423:af7b)
05:36:17 × Inst quits (~delicacie@2601:6c4:4080:3f80:65d0:53d1:d25a:5705) (Ping timeout: 240 seconds)
05:36:41 × mon_aaraj quits (~MonAaraj@user/mon-aaraj/x-4416475) (Ping timeout: 256 seconds)
05:38:30 mon_aaraj joins (~MonAaraj@user/mon-aaraj/x-4416475)
05:40:17 chenqisu1 joins (~chenqisu1@183.217.200.249)
05:42:17 etale joins (~user@2600:8802:2105:7100:721c:e7ff:feda:ed41)
05:42:42 × etale quits (~user@2600:8802:2105:7100:721c:e7ff:feda:ed41) (Client Quit)
05:44:40 × stiell quits (~stiell@gateway/tor-sasl/stiell) (Remote host closed the connection)
05:47:51 × zebrag quits (~chris@user/zebrag) (Quit: Konversation terminated!)
05:49:09 × deadmarshal quits (~deadmarsh@95.38.114.160) (Ping timeout: 256 seconds)
05:53:37 × mon_aaraj quits (~MonAaraj@user/mon-aaraj/x-4416475) (Ping timeout: 240 seconds)
05:54:05 <meer> `/join #powershell
05:54:11 meer is now known as Inst
05:54:49 × pierrot quits (~pi@user/pierrot) (Read error: Connection reset by peer)
05:55:50 mon_aaraj joins (~MonAaraj@user/mon-aaraj/x-4416475)
05:55:59 pierrot joins (~pi@user/pierrot)
06:01:40 Jing joins (~hedgehog@240e:390:7c53:a7e1:d8d5:ad63:210:577a)
06:04:27 × mon_aaraj quits (~MonAaraj@user/mon-aaraj/x-4416475) (Ping timeout: 256 seconds)
06:06:13 mon_aaraj joins (~MonAaraj@user/mon-aaraj/x-4416475)
06:11:04 × little_mac quits (~little_ma@2601:410:4300:3ce0:a45b:6ac9:43c1:2d7f) (Remote host closed the connection)
06:11:19 akegalj joins (~akegalj@93-138-103-111.adsl.net.t-com.hr)
06:16:38 × gaff quits (~gaff@49.207.221.138) (Remote host closed the connection)
06:18:17 × mon_aaraj quits (~MonAaraj@user/mon-aaraj/x-4416475) (Ping timeout: 240 seconds)
06:20:05 yauhsien joins (~yauhsien@61-231-25-133.dynamic-ip.hinet.net)
06:20:33 mon_aaraj joins (~MonAaraj@user/mon-aaraj/x-4416475)
06:22:20 deadmarshal joins (~deadmarsh@95.38.114.160)
06:22:51 glguy joins (x@libera/staff/glguy)
06:23:18 Everything joins (~Everythin@37.115.210.35)
06:24:17 × yauhsien quits (~yauhsien@61-231-25-133.dynamic-ip.hinet.net) (Ping timeout: 240 seconds)
06:24:36 × CiaoSen quits (~Jura@p200300c95737a2002a3a4dfffe84dbd5.dip0.t-ipconnect.de) (Ping timeout: 250 seconds)
06:25:19 mbuf joins (~Shakthi@122.178.180.184)
06:34:29 merijn joins (~merijn@c-001-001-018.client.esciencecenter.eduvpn.nl)
06:43:04 × slowButPresent quits (~slowButPr@user/slowbutpresent) (Quit: leaving)
06:49:19 × geekosaur quits (~geekosaur@xmonad/geekosaur) (Remote host closed the connection)
06:49:43 geekosaur joins (~geekosaur@xmonad/geekosaur)
06:49:56 gaff joins (~gaff@49.207.223.219)
06:52:24 × perrierjouet quits (~perrier-j@modemcable012.251-130-66.mc.videotron.ca) (Quit: WeeChat 3.4)
06:52:40 perrierjouet joins (~perrier-j@modemcable012.251-130-66.mc.videotron.ca)
06:52:51 × mon_aaraj quits (~MonAaraj@user/mon-aaraj/x-4416475) (Ping timeout: 256 seconds)
06:54:53 mon_aaraj joins (~MonAaraj@user/mon-aaraj/x-4416475)
06:55:50 × gaff quits (~gaff@49.207.223.219) (Remote host closed the connection)
06:57:11 gaff joins (~gaff@49.207.223.219)
06:57:27 × kaph quits (~kaph@net-2-47-208-144.cust.vodafonedsl.it) (Read error: Connection reset by peer)
07:02:58 lavaman joins (~lavaman@98.38.249.169)
07:05:21 stiell joins (~stiell@gateway/tor-sasl/stiell)
07:07:17 × lavaman quits (~lavaman@98.38.249.169) (Ping timeout: 240 seconds)
07:07:58 × gaff quits (~gaff@49.207.223.219) (Quit: Bye ...)
07:08:17 × merijn quits (~merijn@c-001-001-018.client.esciencecenter.eduvpn.nl) (Ping timeout: 240 seconds)
07:09:20 takuan joins (~takuan@178-116-218-225.access.telenet.be)
07:11:19 alfonsox joins (~quassel@103.87.57.95)
07:14:37 × mon_aaraj quits (~MonAaraj@user/mon-aaraj/x-4416475) (Ping timeout: 256 seconds)
07:17:33 mon_aaraj joins (~MonAaraj@user/mon-aaraj/x-4416475)
07:19:31 tromp joins (~textual@dhcp-077-249-230-040.chello.nl)
07:21:25 × Erutuon quits (~Erutuon@user/erutuon) (Ping timeout: 256 seconds)
07:26:56 fendor joins (~fendor@178.115.78.100.wireless.dyn.drei.com)
07:27:00 × thebnq quits (~bnq@herrokitty.com) (Remote host closed the connection)
07:27:11 gehmehgeh joins (~user@user/gehmehgeh)
07:40:06 × jonathanx_ quits (~jonathan@h-178-174-176-109.A357.priv.bahnhof.se) (Remote host closed the connection)
07:40:28 jonathanx_ joins (~jonathan@h-178-174-176-109.A357.priv.bahnhof.se)
07:45:17 thebnq joins (~bnq@66-37-19-52.phx.onelemur.com)
07:45:25 × thebnq quits (~bnq@66-37-19-52.phx.onelemur.com) (Remote host closed the connection)
07:47:27 thebnq joins (~bnq@66-37-19-52.phx.onelemur.com)
07:49:32 mikoto-chan joins (~mikoto-ch@213.177.151.239)
07:53:21 burnsidesLlama joins (~burnsides@dhcp168-015.wadham.ox.ac.uk)
07:57:07 × mikoto-chan quits (~mikoto-ch@213.177.151.239) (Ping timeout: 256 seconds)
08:10:13 wroathe joins (~wroathe@206-55-188-8.fttp.usinternet.com)
08:10:13 × wroathe quits (~wroathe@206-55-188-8.fttp.usinternet.com) (Changing host)
08:10:13 wroathe joins (~wroathe@user/wroathe)
08:10:31 Tuplanolla joins (~Tuplanoll@91-159-68-166.elisa-laajakaista.fi)
08:10:39 romesrf joins (~romes@2001:8a0:dd9e:2c00:fd1b:fa:a17:a972)
08:11:44 × eggplantade quits (~Eggplanta@2600:1700:bef1:5e10:c18f:7483:538b:1622) (Remote host closed the connection)
08:12:11 × akegalj quits (~akegalj@93-138-103-111.adsl.net.t-com.hr) (Remote host closed the connection)
08:15:21 × wroathe quits (~wroathe@user/wroathe) (Ping timeout: 256 seconds)
08:15:31 × romesrf quits (~romes@2001:8a0:dd9e:2c00:fd1b:fa:a17:a972) (Ping timeout: 250 seconds)
08:25:15 mikoto-chan joins (~mikoto-ch@213.177.151.239)
08:25:59 `2jt joins (~jtomas@130.red-88-22-46.staticip.rima-tde.net)
08:28:47 enoch joins (~enochthec@115-188-140-207-vdsl.sparkbb.co.nz)
08:28:47 × enoch quits (~enochthec@115-188-140-207-vdsl.sparkbb.co.nz) (Changing host)
08:28:47 enoch joins (~enochthec@user/enochthechronoco)
08:30:37 × Inst quits (~delicacie@2601:6c4:4080:3f80:99ec:65c9:5423:af7b) (Ping timeout: 240 seconds)
08:32:52 × `2jt quits (~jtomas@130.red-88-22-46.staticip.rima-tde.net) (Ping timeout: 250 seconds)
08:34:57 `2jt joins (~jtomas@130.red-88-22-46.staticip.rima-tde.net)
08:35:46 × enoch quits (~enochthec@user/enochthechronoco) (Quit: Igloo IRC: https://iglooirc.com)
08:41:33 <absentia> is `fromEnum` known to be poorly performant?
08:42:08 <sm> is it practical to build static binaries with stack yet ?
08:42:46 xkuru joins (~xkuru@user/xkuru)
08:53:33 × k8yun quits (~k8yun@198-48-158-40.cpe.pppoe.ca) (Ping timeout: 256 seconds)
08:58:26 <sm> does anyone know what this yesod / aeson error is about ? https://paste.tomsmeding.com/B9qeYo3n/raw/1 . Here's the yesod code, how did calling M.lookup on an Object ever work ? M is Data.HashMap.Strict
08:58:27 sm sent a haskell code block: https://libera.ems.host/_matrix/media/r0/download/libera.chat/21fc49443d4049b795911dbe3627a3bd29083634
08:58:55 <vaibhavsagar[m]> It works if you use the latest Aeson
08:59:23 <vaibhavsagar[m]> Since they changed the default to be `Map` instead of `HashMap`
09:00:41 merijn joins (~merijn@c-001-001-018.client.esciencecenter.eduvpn.nl)
09:00:43 <sm> vaibhavsagar: thanks! so yesod should be requiring aeson >= ... 2.0.1.0 ?
09:00:56 <sm> https://hackage.haskell.org/package/aeson-2.0.3.0/changelog is not super informative
09:01:22 × burnsidesLlama quits (~burnsides@dhcp168-015.wadham.ox.ac.uk) (Remote host closed the connection)
09:01:59 <vaibhavsagar[m]> > Make `ordered-keymap` on by default
09:02:00 <lambdabot> <hint>:1:14: error: parse error on input ‘-’
09:02:11 <vaibhavsagar[m]> You're right that it's not informative
09:02:49 <vaibhavsagar[m]> I made a bunch of noise when I learned about it but everyone mostly quietly adapted
09:03:55 <sm> actually this error comes when building with aeson 2.0.3.0 (latest)
09:04:34 <sm> yesod probably needs aeson < 2.0.1.0 then
09:04:57 <sm> thanks for making noise. Normally I am insulated from these things by stackage
09:06:42 Erutuon joins (~Erutuon@user/erutuon)
09:07:24 max22- joins (~maxime@2a01cb0883359800496a3dbe523e6e7d.ipv6.abo.wanadoo.fr)
09:10:09 sm wonders why aeson did that. Usually I see the reverse change
09:11:03 <c_wraith> It guaranteed it would perform well no matter what inputs it receives
09:11:30 <c_wraith> unordered-containers has had some cases pop up where behavior can be forced to O(n^2)
09:12:02 <sm> interesting
09:12:10 eggplantade joins (~Eggplanta@2600:1700:bef1:5e10:1dc4:f5c4:a458:81)
09:12:18 <c_wraith> hashing is not the magic bullet people seem to think it is
09:16:37 × eggplantade quits (~Eggplanta@2600:1700:bef1:5e10:1dc4:f5c4:a458:81) (Ping timeout: 250 seconds)
09:18:17 <Rembane> It's still fun though. Python had similar problems in their hashing algorithms some years ago. They solved it by adding a random salt for every Python interpreter session.
09:25:57 romesrf joins (~romes@2001:8a0:dd9e:2c00:fd1b:fa:a17:a972)
09:29:38 × `2jt quits (~jtomas@130.red-88-22-46.staticip.rima-tde.net) (Ping timeout: 250 seconds)
09:31:17 × romesrf quits (~romes@2001:8a0:dd9e:2c00:fd1b:fa:a17:a972) (Ping timeout: 256 seconds)
09:32:42 burnsidesLlama joins (~burnsides@dhcp168-015.wadham.ox.ac.uk)
09:34:33 fr33domlover joins (~fr33@31.210.181.138)
09:35:36 mc47 joins (~mc47@xmonad/TheMC47)
09:37:22 <jackdk> aeson-2.0 has the new KeyMap type, so if you code to that interface you code should be portable between KeyMap = HashMap and KeyMap = Map. In theory.
09:38:53 × mon_aaraj quits (~MonAaraj@user/mon-aaraj/x-4416475) (Ping timeout: 256 seconds)
09:40:52 mon_aaraj joins (~MonAaraj@user/mon-aaraj/x-4416475)
09:41:18 Inst joins (~delicacie@c-98-208-218-119.hsd1.fl.comcast.net)
09:46:54 × pavonia quits (~user@user/siracusa) (Quit: Bye!)
09:47:57 _ht joins (~quassel@231-169-21-31.ftth.glasoperator.nl)
09:53:16 <sm> yes that was it, current yesod needs aeson < 2
09:59:43 chir4gm joins (~chirag@user/chir4gm)
09:59:54 <chir4gm> How do I modify the search path for ghc
09:59:56 <chir4gm> ?
10:00:39 <chir4gm> I am trying to build a package from source (I don't know any haskell), and I can't seem to get ghc to find the libraries installed in /usr/lib
10:00:48 <chir4gm> I am on arch, if that is of any relevance
10:01:47 × Inst quits (~delicacie@c-98-208-218-119.hsd1.fl.comcast.net) (Ping timeout: 256 seconds)
10:03:32 × Everything quits (~Everythin@37.115.210.35) (Quit: leaving)
10:04:09 × merijn quits (~merijn@c-001-001-018.client.esciencecenter.eduvpn.nl) (Ping timeout: 256 seconds)
10:06:00 <chir4gm> guys?
10:08:57 <Rembane> chir4gm: Do you need to recompile the package all the time or will a binary suffice? Because if you can get a binary and use it it's probably easier than the alternatives.
10:09:14 <chir4gm> I can't really
10:09:21 <chir4gm> I do need to compile it from source
10:09:38 <chir4gm> Is there any way to modify ghc'c search path?
10:09:43 <chir4gm> *ghc's
10:09:57 × fr33domlover quits (~fr33@31.210.181.138) (Ping timeout: 240 seconds)
10:13:09 pretty_dumm_guy joins (trottel@gateway/vpn/protonvpn/prettydummguy/x-88029655)
10:14:06 <Rembane> Cool, then I recommend you to uninstall ghc and all other Haskell related packages. And then install stack using the instructions on stackage.org and compile the project with stack. Does the project have a stack.yml file?
10:15:04 <ephemient> either use stack or ghc+cabal from ghcup; system ghc and libraries are generally not recommended for building anything other than the distro's own packages
10:16:13 <ephemient> archlinux in particular only provides dynamic libraries but because the ABI isn't stable, anything you build with the system's packages will break on every upgrade
10:17:58 <absentia> keep your local pacman tree free of as much haskell as possible
10:18:04 <absentia> it is poorly maintained and hellish during upgrades
10:19:51 × burnsidesLlama quits (~burnsides@dhcp168-015.wadham.ox.ac.uk) (Remote host closed the connection)
10:20:23 burnsidesLlama joins (~burnsides@dhcp168-015.wadham.ox.ac.uk)
10:21:00 <ephemient> I don't know if "poorly maintained" is fair, afaik they have automation to convert cabal versions to pacman build files automatically and that generally works. but it's only usable for archlinux's own packages because everything gets revbumped at once
10:21:32 <ephemient> chir4gm: tl;dr if you're on archlinux, do *not* build your own haskell binaries using the system's haskell packages
10:21:51 <chir4gm> https://github.com/B-Lang-org/bsc
10:21:57 <chir4gm> This is what I am trying to build
10:22:03 <chir4gm> the aur package fails
10:22:12 <chir4gm> So, what do I do here?
10:24:29 burnside_ joins (~burnsides@dhcp168-015.wadham.ox.ac.uk)
10:24:36 × burnsidesLlama quits (~burnsides@dhcp168-015.wadham.ox.ac.uk) (Remote host closed the connection)
10:24:44 × jlamothe quits (~jlamothe@198.251.61.229) (Quit: leaving)
10:25:03 × Vajb quits (~Vajb@hag-jnsbng11-58c3a8-176.dhcp.inet.fi) (Read error: Connection reset by peer)
10:25:22 Vajb joins (~Vajb@hag-jnsbng11-58c3a8-176.dhcp.inet.fi)
10:25:33 <ephemient> https://github.com/B-Lang-org/bsc/blob/main/INSTALL.md has some info about using ghcup/cabal, but it's trying to use the pre-v2 world…
10:26:07 <ephemient> but it should basically work
10:27:30 <ephemient> I feel like the whole project is crazy for using its own recursive Makefile-based build instead of cabal, but that's not something you're gonna be able to fix yourself
10:30:55 ardell joins (~ardell@user/ardell)
10:31:41 romesrf joins (~romes@2001:8a0:dd9e:2c00:fd1b:fa:a17:a972)
10:34:16 Everything joins (~Everythin@37.115.210.35)
10:35:46 Everything parts (~Everythin@37.115.210.35) ()
10:36:21 × romesrf quits (~romes@2001:8a0:dd9e:2c00:fd1b:fa:a17:a972) (Ping timeout: 250 seconds)
10:36:57 jlamothe joins (~jlamothe@198.251.61.229)
10:37:57 romesrf joins (~romes@2001:8a0:dd9e:2c00:fd1b:fa:a17:a972)
10:42:47 × romesrf quits (~romes@2001:8a0:dd9e:2c00:fd1b:fa:a17:a972) (Ping timeout: 252 seconds)
10:42:54 × Erutuon quits (~Erutuon@user/erutuon) (Ping timeout: 260 seconds)
10:45:52 × tzh quits (~tzh@c-24-21-73-154.hsd1.wa.comcast.net) (Quit: zzz)
10:48:34 MajorBiscuit joins (~MajorBisc@86-88-79-148.fixed.kpn.net)
10:55:30 × Vajb quits (~Vajb@hag-jnsbng11-58c3a8-176.dhcp.inet.fi) (Read error: Connection reset by peer)
10:55:58 Vajb joins (~Vajb@2001:999:274:c862:3b86:e1e1:5bff:355e)
10:56:26 Lord_of_Life_ joins (~Lord@user/lord-of-life/x-2819915)
10:56:43 romesrf joins (~romes@2001:8a0:dd9e:2c00:fd1b:fa:a17:a972)
10:56:57 Hildegunst joins (~luc@80.248.12.109.rev.sfr.net)
10:57:39 × Lord_of_Life quits (~Lord@user/lord-of-life/x-2819915) (Ping timeout: 256 seconds)
10:57:44 Lord_of_Life_ is now known as Lord_of_Life
10:58:58 Erutuon joins (~Erutuon@user/erutuon)
10:59:36 __monty__ joins (~toonn@user/toonn)
10:59:55 × amk quits (~amk@109.255.169.126) (Ping timeout: 256 seconds)
11:00:23 × Vajb quits (~Vajb@2001:999:274:c862:3b86:e1e1:5bff:355e) (Ping timeout: 250 seconds)
11:00:26 amk joins (~amk@109.255.169.126)
11:01:05 Vajb joins (~Vajb@hag-jnsbng11-58c3a8-176.dhcp.inet.fi)
11:09:25 × fef quits (~thedawn@user/thedawn) (Quit: Leaving)
11:09:32 × Erutuon quits (~Erutuon@user/erutuon) (Quit: WeeChat 2.8)
11:18:11 × mc47 quits (~mc47@xmonad/TheMC47) (Remote host closed the connection)
11:20:31 × Sgeo quits (~Sgeo@user/sgeo) (Read error: Connection reset by peer)
11:22:44 × Vajb quits (~Vajb@hag-jnsbng11-58c3a8-176.dhcp.inet.fi) (Read error: Connection reset by peer)
11:23:47 Vajb joins (~Vajb@2001:999:274:c862:3b86:e1e1:5bff:355e)
11:25:38 × Vajb quits (~Vajb@2001:999:274:c862:3b86:e1e1:5bff:355e) (Read error: Connection reset by peer)
11:25:46 × oscurochu quits (~oscurochu@097-096-050-227.res.spectrum.com) (Remote host closed the connection)
11:25:56 Vajb joins (~Vajb@hag-jnsbng11-58c3a8-176.dhcp.inet.fi)
11:27:43 × tdammers quits (~tdammers@77.109.72.177.res.static.edpnet.net) (Quit: WeeChat 3.0)
11:27:44 CHUD joins (~CHUD@dhcp6353.kent.ac.uk)
11:29:09 × romesrf quits (~romes@2001:8a0:dd9e:2c00:fd1b:fa:a17:a972) (Ping timeout: 256 seconds)
11:31:32 × econo quits (uid147250@user/econo) (Quit: Connection closed for inactivity)
11:32:18 rtsn joins (~nstr@user/rtsn)
11:40:26 MochizukisLastTh joins (~Mochizuki@112-68-46-13f1.osk2.eonet.ne.jp)
11:41:03 × _xor quits (~xor@dsl-50-5-233-169.fuse.net) (Ping timeout: 256 seconds)
11:42:52 _xor joins (~xor@dsl-50-5-233-169.fuse.net)
11:43:41 `2jt joins (~jtomas@130.red-88-22-46.staticip.rima-tde.net)
11:55:07 × MajorBiscuit quits (~MajorBisc@86-88-79-148.fixed.kpn.net) (Ping timeout: 256 seconds)
11:56:21 oscuroch_ joins (~oscurochu@097-096-050-227.res.spectrum.com)
11:57:36 Inst joins (~delicacie@2601:6c4:4080:3f80:c32:f815:8539:fe9a)
12:00:21 romesrf joins (~romes@2001:8a0:dd9e:2c00:fd1b:fa:a17:a972)
12:00:37 merijn joins (~merijn@c-001-001-018.client.esciencecenter.eduvpn.nl)
12:02:04 × CHUD quits (~CHUD@dhcp6353.kent.ac.uk) (Remote host closed the connection)
12:03:08 × mbuf quits (~Shakthi@122.178.180.184) (Quit: Leaving)
12:06:03 × max22- quits (~maxime@2a01cb0883359800496a3dbe523e6e7d.ipv6.abo.wanadoo.fr) (Ping timeout: 250 seconds)
12:09:01 × chenqisu1 quits (~chenqisu1@183.217.200.249) (Quit: Leaving)
12:09:17 × Akiva quits (~Akiva@user/Akiva) (Ping timeout: 256 seconds)
12:09:22 RFV joins (~Thunderbi@187.red-88-13-186.dynamicip.rima-tde.net)
12:10:58 × burnside_ quits (~burnsides@dhcp168-015.wadham.ox.ac.uk) (Remote host closed the connection)
12:10:59 × mon_aaraj quits (~MonAaraj@user/mon-aaraj/x-4416475) (Ping timeout: 256 seconds)
12:11:30 burnsidesLlama joins (~burnsides@dhcp168-015.wadham.ox.ac.uk)
12:12:20 CHUD joins (~CHUD@dhcp6353.kent.ac.uk)
12:12:48 mon_aaraj joins (~MonAaraj@user/mon-aaraj/x-4416475)
12:15:23 × CHUD quits (~CHUD@dhcp6353.kent.ac.uk) (Remote host closed the connection)
12:15:45 CHUD joins (~CHUD@dhcp6353.kent.ac.uk)
12:16:11 × burnsidesLlama quits (~burnsides@dhcp168-015.wadham.ox.ac.uk) (Ping timeout: 256 seconds)
12:16:22 oem22 joins (xyz@151.30.129.165)
12:17:33 × cynomys quits (~cynomys@user/cynomys) (Ping timeout: 256 seconds)
12:21:05 × oem22 quits (xyz@151.30.129.165) (Quit: Going offline, see ya! (www.adiirc.com))
12:21:50 × romesrf quits (~romes@2001:8a0:dd9e:2c00:fd1b:fa:a17:a972) (Ping timeout: 260 seconds)
12:22:37 × oscuroch_ quits (~oscurochu@097-096-050-227.res.spectrum.com) (Ping timeout: 240 seconds)
12:25:48 × hololeap quits (~hololeap@user/hololeap) (Remote host closed the connection)
12:27:11 hololeap joins (~hololeap@user/hololeap)
12:27:45 × jespada quits (~jespada@87.74.36.188) (Ping timeout: 256 seconds)
12:28:42 oem joins (Username@151.30.129.165)
12:29:20 × CHUD quits (~CHUD@dhcp6353.kent.ac.uk) (Quit: Client closed)
12:29:32 × oem quits (Username@151.30.129.165) (Client Quit)
12:30:07 <absentia> `type Foo = Int; type Bar = Char; data Foobar = Foobar Foo Bar deriving (Eq, Read, Show)
12:30:17 × emf quits (~emf@2620:10d:c090:400::5:ab3f) (Ping timeout: 240 seconds)
12:30:17 jespada joins (~jespada@87.74.36.188)
12:30:25 <absentia> `f (Foobar f b) = (f - 1, fromEnum b - 97)`
12:30:38 <absentia> does anything stick out here as to why this may perform poorly
12:31:19 × RFV quits (~Thunderbi@187.red-88-13-186.dynamicip.rima-tde.net) (Quit: RFV)
12:31:35 <absentia> profiling reveals i'm spending a lot of time in `f`, not sure if it's because the implementation is poor or if I'm just hammering it that often
12:32:42 emf joins (~emf@163.114.132.4)
12:32:44 <absentia> that should probably be `f (Foobar foo bar) = (foo - 1, fromEnum bar - 97)`
12:33:30 <Rembane> absentia: What's the bigger algorithm? Something Fibonacci-series-definition like?
12:33:47 MajorBiscuit joins (~MajorBisc@86-88-79-148.fixed.kpn.net)
12:34:35 <absentia> Rembane: this is a utility function for converting between different systems of indexing into a bitboard
12:34:45 <absentia> probably i should just use one representation
12:34:47 × merijn quits (~merijn@c-001-001-018.client.esciencecenter.eduvpn.nl) (Ping timeout: 256 seconds)
12:34:51 <maerwald> ephemient: I don't think it's crazy
12:34:54 <absentia> because it's used everywhere
12:35:24 <absentia> is `fromEnum` known to be slow? or tuple construction?
12:35:35 <absentia> i find haskell performance baffling to reason about
12:37:10 <Rembane> absentia: Got it. Then it shouldn't be that slow. How many times is the function called?
12:38:00 <maerwald> ephemient: afair it's also possible to make it work with v2-install
12:39:11 <ephemient> yeah you can get cabal to write an env file right?
12:40:16 <absentia> Rembane: tens of millions of times
12:40:27 absentia shrugs
12:40:49 <absentia> going by the "entries" in a `stack test --profile` generated `.prof`
12:40:57 <absentia> 14% of time spent here
12:41:30 × whatsupdoc quits (uid509081@id-509081.hampstead.irccloud.com) (Quit: Connection closed for inactivity)
12:41:50 <absentia> those tens of millions of calls/entries are only 10% of all entries
12:43:03 <absentia> `fromEnum` for `Char` appears to just be `ord`
12:43:08 <absentia> which I can't imagine being slow, but...
12:43:38 <absentia> wish I could get deeper call trees in the profile
12:44:21 <Rembane> absentia: It could be slow if laziness bites you. Laziness is hard to reason about though so I usually fail at that reasoning. What happens if you replace the tuple with a custom data type using bang patterns? Do things go faster?
12:44:53 absentia googles for a bang patterns refresher
12:45:04 <absentia> never had to actually optimize haskell or care about laziness before so here goes
12:45:24 <absentia> oh god, the lack of night mode
12:45:26 <absentia> it burns!
12:46:34 Rembane hands absentia sun glasses
12:47:56 <absentia> > eliminating thunks from an inner loop
12:47:58 <lambdabot> error:
12:47:58 <lambdabot> Variable not in scope:
12:47:58 <lambdabot> eliminating
12:47:58 <absentia> sounds right
12:48:05 <absentia> bad lambdabot :|
12:50:26 <Andrew> > (\x -> x x)(\x -> x x)
12:50:28 <lambdabot> error:
12:50:28 <lambdabot> • Occurs check: cannot construct the infinite type: t0 ~ t0 -> t
12:50:28 <lambdabot> • In the first argument of ‘x’, namely ‘x’
12:54:24 <maerwald> ephemient: I just checked the link... there are instructions for v2-install already
12:54:43 × deadmarshal quits (~deadmarsh@95.38.114.160) (Ping timeout: 256 seconds)
12:56:38 <absentia> Rembane: wew, even without a custom data type and just using BangPatterns (as in `f (Foobar !f !b)`) resulted in over 50% speedup
12:56:57 deadmarshal joins (~deadmarsh@95.38.112.249)
12:57:00 <absentia> less alloc too, which I guess is because of the smaller number of thunks in memory?
12:57:24 <absentia> 1s wall clock speedup
12:57:29 <Rembane> absentia: Sweet! Yes, not as much bookkeeping is needed. Thunks are lightweight, but there is some process around them.
12:58:01 <Rembane> absentia: Also, tuples are lazy, which I forgot to mention.
12:58:17 <absentia> I was just googling for strict tuples
12:58:24 <absentia> because I'm still noticing 20% of alloc coming from that fn
13:06:31 <maerwald> that looks like StrictData may help already
13:06:58 <maerwald> as in `Foobar !f !b` indicates that
13:07:34 <maerwald> despite people here rambling about that extension
13:09:09 CHUD joins (~CHUD@dhcp636F.kent.ac.uk)
13:09:22 fr33domlover joins (~fr33@31.210.181.138)
13:13:38 yauhsie__ joins (~yauhsien@61-231-25-133.dynamic-ip.hinet.net)
13:15:47 <absentia> Rembane: daaaaaaaaamn, that function has now fallen off the top cost centre summary
13:15:53 <absentia> by converting everything to Data.Strict.Tuple
13:15:57 <absentia> thanks very much for the help
13:16:17 <absentia> that's another 1s of wall time shaved off this suite
13:16:58 machinedgod joins (~machinedg@24.105.81.50)
13:17:37 × fr33domlover quits (~fr33@31.210.181.138) (Ping timeout: 256 seconds)
13:19:13 <Rembane> absentia: Awesome! :D No worries.
13:23:21 burnsidesLlama joins (~burnsides@dhcp168-015.wadham.ox.ac.uk)
13:25:32 x_kuru joins (~xkuru@user/xkuru)
13:26:57 × xkuru quits (~xkuru@user/xkuru) (Ping timeout: 240 seconds)
13:28:28 burnside_ joins (~burnsides@dhcp168-015.wadham.ox.ac.uk)
13:28:57 × burnsidesLlama quits (~burnsides@dhcp168-015.wadham.ox.ac.uk) (Ping timeout: 256 seconds)
13:30:07 × jonathanx_ quits (~jonathan@h-178-174-176-109.A357.priv.bahnhof.se) (Remote host closed the connection)
13:30:25 jonathanx_ joins (~jonathan@h-178-174-176-109.A357.priv.bahnhof.se)
13:30:45 fr33domlover joins (~fr33@31.210.181.138)
13:38:41 romesrf joins (~romes@2001:8a0:dd9e:2c00:fd1b:fa:a17:a972)
13:41:02 RFV joins (~Thunderbi@187.red-88-13-186.dynamicip.rima-tde.net)
13:43:58 × romesrf quits (~romes@2001:8a0:dd9e:2c00:fd1b:fa:a17:a972) (Ping timeout: 260 seconds)
13:45:51 × CHUD quits (~CHUD@dhcp636F.kent.ac.uk) (Quit: Client closed)
13:58:37 × jonathanx_ quits (~jonathan@h-178-174-176-109.A357.priv.bahnhof.se) (Remote host closed the connection)
13:59:01 jonathanx_ joins (~jonathan@h-178-174-176-109.A357.priv.bahnhof.se)
13:59:14 × ardell quits (~ardell@user/ardell) (Quit: Konversation terminated!)
13:59:57 × dibblego quits (~dibblego@haskell/developer/dibblego) (Ping timeout: 240 seconds)
14:03:37 × shailangsa quits (~shailangs@host86-185-98-37.range86-185.btcentralplus.com) (Remote host closed the connection)
14:13:02 RFV1 joins (~Thunderbi@187.red-88-13-186.dynamicip.rima-tde.net)
14:13:57 × mstksg quits (~jle`@cpe-23-240-75-236.socal.res.rr.com) (Ping timeout: 256 seconds)
14:14:30 × Hildegunst quits (~luc@80.248.12.109.rev.sfr.net) (Quit: leaving)
14:14:31 × MajorBiscuit quits (~MajorBisc@86-88-79-148.fixed.kpn.net) (Ping timeout: 256 seconds)
14:15:39 mstksg joins (~jle`@cpe-23-240-75-236.socal.res.rr.com)
14:15:42 × RFV quits (~Thunderbi@187.red-88-13-186.dynamicip.rima-tde.net) (Ping timeout: 260 seconds)
14:15:42 RFV1 is now known as RFV
14:16:31 eggplantade joins (~Eggplanta@2600:1700:bef1:5e10:1dc4:f5c4:a458:81)
14:16:40 × fr33domlover quits (~fr33@31.210.181.138) (Quit: fr33domlover)
14:17:54 × yauhsie__ quits (~yauhsien@61-231-25-133.dynamic-ip.hinet.net) (Remote host closed the connection)
14:19:35 ec joins (~ec@gateway/tor-sasl/ec)
14:20:50 × eggplantade quits (~Eggplanta@2600:1700:bef1:5e10:1dc4:f5c4:a458:81) (Ping timeout: 250 seconds)
14:24:18 yauhsien joins (~yauhsien@61-231-25-133.dynamic-ip.hinet.net)
14:26:35 tatarqa joins (~kli@ip-89-177-122-45.net.upcbroadband.cz)
14:27:27 <absentia> now if only i could optimize docker container size
14:27:34 <absentia> my god stack builder images are enormous
14:27:36 <absentia> almost 5 gb!
14:27:46 <Hecate> yes
14:27:47 <absentia> s/container/image
14:28:09 <absentia> they won't even build on my container provider
14:28:13 <absentia> runs out of memory
14:28:26 szkl joins (uid110435@id-110435.uxbridge.irccloud.com)
14:29:14 × yauhsien quits (~yauhsien@61-231-25-133.dynamic-ip.hinet.net) (Ping timeout: 260 seconds)
14:31:26 × geekosaur quits (~geekosaur@xmonad/geekosaur) (Killed (NickServ (GHOST command used by allbery_b)))
14:31:26 allbery_b joins (~geekosaur@xmonad/geekosaur)
14:31:27 merijn joins (~merijn@c-001-001-018.client.esciencecenter.eduvpn.nl)
14:31:29 allbery_b is now known as geekosaur
14:33:30 × RFV quits (~Thunderbi@187.red-88-13-186.dynamicip.rima-tde.net) (Quit: RFV)
14:36:27 raehik joins (~raehik@cpc95906-rdng25-2-0-cust156.15-3.cable.virginm.net)
14:44:11 n3rdy1 joins (~n3rdy1@2600:1700:4570:3480::41)
14:46:17 × mvk quits (~mvk@2607:fea8:5cdc:bf00::80f1) (Ping timeout: 240 seconds)
14:52:00 × dajoer quits (~david@user/gvx) (Quit: leaving)
15:00:54 CHUD joins (~CHUD@dhcp636F.kent.ac.uk)
15:05:27 × merijn quits (~merijn@c-001-001-018.client.esciencecenter.eduvpn.nl) (Ping timeout: 250 seconds)
15:10:58 dibblego joins (~dibblego@122-199-1-30.ip4.superloop.com)
15:10:58 × dibblego quits (~dibblego@122-199-1-30.ip4.superloop.com) (Changing host)
15:10:58 dibblego joins (~dibblego@haskell/developer/dibblego)
15:16:55 × EvanR quits (~EvanR@user/evanr) (Remote host closed the connection)
15:17:14 EvanR joins (~EvanR@user/evanr)
15:20:57 × mon_aaraj quits (~MonAaraj@user/mon-aaraj/x-4416475) (Ping timeout: 240 seconds)
15:23:11 mon_aaraj joins (~MonAaraj@user/mon-aaraj/x-4416475)
15:24:08 ardell joins (~ardell@user/ardell)
15:25:04 yauhsien joins (~yauhsien@61-231-25-133.dynamic-ip.hinet.net)
15:29:53 × yauhsien quits (~yauhsien@61-231-25-133.dynamic-ip.hinet.net) (Ping timeout: 256 seconds)
15:31:16 shapr joins (~user@pool-173-73-44-186.washdc.fios.verizon.net)
15:31:17 × n3rdy1 quits (~n3rdy1@2600:1700:4570:3480::41) (Ping timeout: 240 seconds)
15:33:29 slit13 joins (~slit13@2a02:2f0b:b50c:7e00:3ffb:8f5b:b927:cbd9)
15:34:39 × slit13 quits (~slit13@2a02:2f0b:b50c:7e00:3ffb:8f5b:b927:cbd9) (Client Quit)
15:35:27 × wyrd_ quits (~wyrd@gateway/tor-sasl/wyrd) (Ping timeout: 276 seconds)
15:40:08 <maerwald> absentia: unpacked
15:40:53 <maerwald> ~2GB of those will be from GHC
15:44:17 n3rdy1 joins (~n3rdy1@2600:1700:4570:3480:1b88:50f:dae0:9293)
15:46:17 × xff0x quits (~xff0x@2001:1a81:52c7:8c00:1f7f:998e:5249:4548) (Ping timeout: 240 seconds)
15:46:36 mvk joins (~mvk@2607:fea8:5cdc:bf00::80f1)
15:47:28 xff0x joins (~xff0x@2001:1a81:52c7:8c00:f773:af87:1684:89e3)
15:53:06 jao joins (~jao@static-68-235-44-10.cust.tzulo.com)
15:55:05 CiaoSen joins (~Jura@p200300c95737a2002a3a4dfffe84dbd5.dip0.t-ipconnect.de)
15:56:07 <DigitalKiwi> https://grahamc.com/blog/nix-and-layered-docker-images
15:57:34 <DigitalKiwi> Zhttps://christine.website/blog/i-was-wrong-about-nix-2020-02-10
15:58:43 <albet70> what's the point to make a new type? like newtype StateRefT s m a = StateRefT (ReaderT (IORef s) m a), just use ReaderT (IORef s) m a isn't enough?
15:58:56 × Andrew quits (~andrew@user/AndrewYu) (Quit: Leaving)
15:59:14 Andrew joins (~andrew@user/AndrewYu)
15:59:56 × Andrew quits (~andrew@user/AndrewYu) (Client Quit)
16:00:08 Andrew joins (Andrew@user/AndrewYu)
16:00:21 <sshine> albet70, 1) to make your abstraction opaque, 2) to avoid the type class instances of what it aliases to, and consequently, so you can give it new type class instances without having them propagate back to the type they alias.
16:00:25 × Topik[m] quits (~topikmatr@2001:470:69fc:105::a082) (Quit: You have been kicked for being idle)
16:00:49 × ardell quits (~ardell@user/ardell) (Quit: Konversation terminated!)
16:03:12 <sshine> albet70, for example: https://hackage.haskell.org/package/base-4.16.0.0/docs/Data-Monoid.html#t:Product
16:04:13 <sshine> albet70, you could say 'instance Monoid Int where ...', but this isn't the only well-defined Monoid instance on Int. so you invent a wrapper for that particular instance.
16:04:44 <sshine> albet70, I guess in your case, it is mostly to make the abstraction opaque.
16:05:52 <albet70> "🟢 sshine :albet70, I guess in your case, it is mostly to make the abstraction opaque.", but abstraction opaque just make people not easy to read
16:06:13 <sshine> i.e. hide the implementation. not sure it's always preferrable. some people have that in an .Internal module so that you can refer to the ReaderT without the wrapper, but not make a commitment to that implementation in front of all who rely on the package.
16:06:43 <sshine> albet70, not just. also makes people not start to rely on the implementation in ways you don't want.
16:11:14 <albet70> sshine, newtype CoroutineT r m a = CoroutineT {runCoroutineT' :: ContT r (StateT [CoroutineT r m ()] m) a} this type is too difficult to understand
16:12:22 <albet70> just ContT r (StateT [ContT r m ()] m) a isn't enough?
16:12:31 <geekosaur> that's not because it's a newtype, it's because Cont is your favorite nightmare come to life
16:13:18 <albet70> I don't know how the people make this non-readable type
16:14:18 bontaq joins (~user@ool-45779fe5.dyn.optonline.net)
16:14:40 <albet70> and it's a recursive type?
16:15:03 × _xor quits (~xor@dsl-50-5-233-169.fuse.net) (Read error: Connection reset by peer)
16:15:10 <albet70> haskell support recursive type?
16:15:43 <geekosaur> sure. I mean, list is a recursive type
16:15:56 <vaibhavsagar[m]> yes
16:15:58 <geekosaur> Trees are recursive types
16:16:17 <albet70> "geekosaur :sure. I mean, list is a recursive type", what's the function type when the function returns itself?
16:16:56 <geekosaur> data List a = Nil | Cons a (List a) -- with base case, even
16:17:09 <vaibhavsagar[m]> for lists, an example is `tail`, which has the type signature `[a] -> [a]`
16:17:29 _xor joins (~xor@dsl-50-5-233-169.fuse.net)
16:17:35 <geekosaur> the base case for the `CoroutineT` type is an empty list of recursive `CoroutineT`s
16:18:15 <absentia> a tree of coroutine transformers?
16:18:17 <absentia> welcome to hell
16:18:35 <geekosaur> hencemy initial comment about nightmares
16:19:24 <albet70> "geekosaur :the base case for the `CoroutineT` type is an empty list of recursive `CoroutineT`s", it doesn't say the m is []
16:19:48 <geekosaur> it doesn't have to, it says it's a list. lists can be empty
16:19:48 <absentia> albet70: `m` is a type-level variable, `[]` is a term-level constructor
16:19:50 <albet70> oh, the whole CoroutineT is []
16:19:54 <geekosaur> it didn't say it's a NonEmpty
16:21:14 <albet70> so recursive type with a base case can be expressed in haskell, right?
16:21:21 <absentia> absolutely
16:21:34 <geekosaur> yes. as can recursive types with no base case (this is often used for streams)
16:21:40 <albet70> function return itself doesn't have a base case, can't it?
16:24:20 <geekosaur> I don't understand the question, sorry
16:25:20 <albet70> if a function return itself, could it be expressed?
16:25:37 <ski> "the base case for the `CoroutineT` type is an empty list of recursive `CoroutineT`s" -- no, the list doesn't occur covariantly/positively
16:25:59 <ski> albet70 : with a recursive type, sure
16:26:51 [itchyjunk] joins (~itchyjunk@user/itchyjunk/x-7353470)
16:27:01 romesrf joins (~romes@2001:8a0:dd9e:2c00:fd1b:fa:a17:a972)
16:27:34 <albet70> "🟢 ski :albet70 : with a recursive type, sure", in js, f = _ => f, what's its type?
16:28:09 <ski> albet70 : `result where result = a -> result'
16:28:29 <albet70> f _ = f
16:28:38 <ski> you can try this, in `ocaml -rectypes', it allows cyclic types (equi-recursive types)
16:28:47 <ski> newtype Munch a = MkMunch (a -> Munch a)
16:28:53 <ski> munch :: a -> Munch a
16:29:01 <ski> munch _ = MkMunch munch
16:29:22 <albet70> fixed point...
16:31:30 <ski> "a tree of coroutine transformers?" -- no. a coroutine action is a function that accepts a list of coroutine actions, and produces a new such list, together with a result value
16:31:31 <albet70> then what value has this type?
16:31:43 <ski> which type ?
16:31:50 <albet70> "ski : newtype Munch a = MkMunch (a -> Munch a)", this
16:32:02 <ski> e.g. `MkMunch munch' has type `Munch a'
16:33:03 <ski> you could say `fix (MkMunch . const)', if you prefer
16:33:39 <ski> of course, `Munch a' is a pretty useless type ..
16:34:13 <ski> (i guess you could define `Munch a -> [a] -> b')
16:34:26 <ski> (or s/[a]/Stream a/)
16:35:23 Null_A joins (~null_a@2601:645:8700:2290:dcf9:b60:3266:d217)
16:36:30 <albet70> ski what do u think what's the benefit to make a new type to wrap? like newtype StateRefT s m a = StateRefT (ReaderT (IORef s) m a), just use ReaderT (IORef s) m a isn't enough?
16:37:39 <ski> for base case for `CoroutineT r m a', you'll be provided already with a list of coroutines. so, you could simply return those, or ignore them (returning an empty list). but it's not just "empty list" is *the* base case, since you're always provided with such a list. you could reverse the list, e.g. ..
16:38:21 <ski> albet70 : i think sshine already answered that
16:39:00 <albet70> yes...
16:39:01 <ski> (i was about to answer at the time, but sshine already covered it well)
16:43:24 × Vajb quits (~Vajb@hag-jnsbng11-58c3a8-176.dhcp.inet.fi) (Ping timeout: 250 seconds)
16:48:35 zebrag joins (~chris@user/zebrag)
16:50:17 × CiaoSen quits (~Jura@p200300c95737a2002a3a4dfffe84dbd5.dip0.t-ipconnect.de) (Ping timeout: 240 seconds)
16:51:06 × romesrf quits (~romes@2001:8a0:dd9e:2c00:fd1b:fa:a17:a972) (Quit: WeeChat 3.4)
16:51:49 × CHUD quits (~CHUD@dhcp636F.kent.ac.uk) (Remote host closed the connection)
16:51:51 wroathe joins (~wroathe@206-55-188-8.fttp.usinternet.com)
16:51:51 × wroathe quits (~wroathe@206-55-188-8.fttp.usinternet.com) (Changing host)
16:51:51 wroathe joins (~wroathe@user/wroathe)
16:54:37 × alfonsox quits (~quassel@103.87.57.95) (Remote host closed the connection)
16:55:59 Vajb joins (~Vajb@hag-jnsbng11-58c3a8-176.dhcp.inet.fi)
16:56:55 × wroathe quits (~wroathe@user/wroathe) (Ping timeout: 256 seconds)
17:01:52 merijn joins (~merijn@c-001-001-018.client.esciencecenter.eduvpn.nl)
17:02:16 slowButPresent joins (~slowButPr@user/slowbutpresent)
17:03:21 <sshine> > let f x = f in f 0
17:03:22 <lambdabot> error:
17:03:22 <lambdabot> • Occurs check: cannot construct the infinite type: t1 ~ p0 -> t1
17:03:22 <lambdabot> • In the expression: let f x = f in f 0
17:03:42 <sshine> albet70, so that's something you can't do.
17:04:40 <sshine> albet70, this function would have the type 'a -> (a -> (a -> ...))'
17:04:55 <sshine> albet70, but as long as it recurses on its values, that's fine :)
17:04:55 <ski> <ski> albet70 : `result where result = a -> result'
17:05:13 wroathe joins (~wroathe@206-55-188-8.fttp.usinternet.com)
17:05:13 × wroathe quits (~wroathe@206-55-188-8.fttp.usinternet.com) (Changing host)
17:05:13 wroathe joins (~wroathe@user/wroathe)
17:08:19 × Alex_test quits (~al_test@94.233.241.94) (Quit: ;-)
17:08:32 × AlexZenon quits (~alzenon@94.233.241.94) (Quit: ;-)
17:08:41 × AlexNoo quits (~AlexNoo@94.233.241.94) (Quit: Leaving)
17:09:03 × ec quits (~ec@gateway/tor-sasl/ec) (Ping timeout: 276 seconds)
17:11:10 × derelict quits (derelict@user/derelict) (Quit: bye)
17:11:44 derelict joins (derelict@user/derelict)
17:12:45 econo joins (uid147250@user/econo)
17:14:33 yauhsien joins (~yauhsien@61-231-25-133.dynamic-ip.hinet.net)
17:19:02 texasmynsted joins (~texasmyns@99.96.221.112)
17:19:20 eggplantade joins (~Eggplanta@2600:1700:bef1:5e10:1dc4:f5c4:a458:81)
17:19:35 × yauhsien quits (~yauhsien@61-231-25-133.dynamic-ip.hinet.net) (Ping timeout: 256 seconds)
17:20:00 <texasmynsted> I have been looking around hackage... I tried jacinda, which is fun, but I am still looking for awk alternatives for parsing whole files.
17:20:23 × mon_aaraj quits (~MonAaraj@user/mon-aaraj/x-4416475) (Ping timeout: 256 seconds)
17:21:06 <texasmynsted> I have files in various formats that I am looking for a handful of items. I think the next thing I will try is `replace-megaparsec`.
17:21:21 <texasmynsted> What would you suggest I take a look at?
17:21:44 cosimone joins (~user@2001:b07:ae5:db26:c24a:d20:4d91:1e20)
17:21:45 <texasmynsted> Oh one of my key criteria is zero regular expresions.
17:22:29 mon_aaraj joins (~MonAaraj@user/mon-aaraj/x-4416475)
17:22:53 <texasmynsted> Jacinda is fun but does use regular expressions. I think there must be (many) raw Haskell solutions?
17:23:51 cuz` joins (~user@23-30-167-57-static.hfc.comcastbusiness.net)
17:23:51 MajorBiscuit joins (~MajorBisc@2a02:a461:129d:1:193d:75d8:745d:e91e)
17:30:34 <hololeap> texasmynsted: what about just megaparsec?
17:31:38 little_mac joins (~little_ma@2601:410:4300:3ce0:8900:f68f:743:8461)
17:32:19 <hololeap> the thing about parser combinators is that you can break the parsing down into small pieces and then recombine them. it's a really nice interface IMO.
17:33:39 <hololeap> megaparsec is good for whole files, attoparsec is probably better for parsing streams
17:34:55 × Null_A quits (~null_a@2601:645:8700:2290:dcf9:b60:3266:d217) (Remote host closed the connection)
17:35:32 fef joins (~thedawn@user/thedawn)
17:35:41 × merijn quits (~merijn@c-001-001-018.client.esciencecenter.eduvpn.nl) (Ping timeout: 256 seconds)
17:37:59 Null_A joins (~null_a@c-98-210-133-39.hsd1.ca.comcast.net)
17:38:49 <absentia> why megaparsec over parsec?
17:39:06 <absentia> is one not galaxy scale enough?
17:40:02 <absentia> we only produce interstellar certified software
17:41:25 <hololeap> from what I've read, megaparsec is faster. it is more flexible with what types it can handle. tbh, I haven't used parsec in a while, so I could be off-base here, but it seems to me megaparsec supercedes parsec
17:41:47 <absentia> i see
17:42:31 <hololeap> https://hackage.haskell.org/package/megaparsec#megaparsec-vs-parsec
17:42:53 <absentia> > more powerful combinators
17:42:54 <lambdabot> error:
17:42:54 <lambdabot> • Variable not in scope: more :: t0 -> t1 -> t
17:42:54 <lambdabot> • Perhaps you meant ‘mode’ (imported from Text.PrettyPrint.HughesPJ)erro...
17:43:01 <absentia> that's saying quite a lot, parsec is already choc full of them
17:43:14 max22- joins (~maxime@lfbn-ren-1-1026-62.w92-139.abo.wanadoo.fr)
17:47:45 × Null_A quits (~null_a@c-98-210-133-39.hsd1.ca.comcast.net) (Remote host closed the connection)
17:48:47 maxime_ joins (~maxime@2a01cb08833598006800cd803015c082.ipv6.abo.wanadoo.fr)
17:50:34 Null_A joins (~null_a@2601:645:8700:2290:dcf9:b60:3266:d217)
17:51:19 × max22- quits (~maxime@lfbn-ren-1-1026-62.w92-139.abo.wanadoo.fr) (Ping timeout: 256 seconds)
17:51:34 k8yun joins (~k8yun@198-48-158-40.cpe.pppoe.ca)
17:52:44 tzh joins (~tzh@c-24-21-73-154.hsd1.or.comcast.net)
17:54:29 × wroathe quits (~wroathe@user/wroathe) (Ping timeout: 256 seconds)
17:54:38 CiaoSen joins (~Jura@p200300c95737a2002a3a4dfffe84dbd5.dip0.t-ipconnect.de)
17:54:57 × emf quits (~emf@163.114.132.4) (Ping timeout: 240 seconds)
17:57:03 k8yun_ joins (~k8yun@198-48-158-40.cpe.pppoe.ca)
17:57:15 emf joins (~emf@2620:10d:c090:400::5:ab3f)
17:57:42 zincy joins (~zincy@host86-151-99-97.range86-151.btcentralplus.com)
18:00:20 × Null_A quits (~null_a@2601:645:8700:2290:dcf9:b60:3266:d217) (Remote host closed the connection)
18:00:37 × pretty_dumm_guy quits (trottel@gateway/vpn/protonvpn/prettydummguy/x-88029655) (Ping timeout: 240 seconds)
18:00:51 wroathe joins (~wroathe@206-55-188-8.fttp.usinternet.com)
18:00:51 × wroathe quits (~wroathe@206-55-188-8.fttp.usinternet.com) (Changing host)
18:00:51 wroathe joins (~wroathe@user/wroathe)
18:00:57 × k8yun quits (~k8yun@198-48-158-40.cpe.pppoe.ca) (Ping timeout: 256 seconds)
18:05:29 × wroathe quits (~wroathe@user/wroathe) (Ping timeout: 256 seconds)
18:06:06 waleee joins (~waleee@2001:9b0:21d:fc00:398f:b003:b90d:acf4)
18:06:53 × cuz` quits (~user@23-30-167-57-static.hfc.comcastbusiness.net) (Read error: Connection reset by peer)
18:06:54 k8yun__ joins (~k8yun@24.244.29.99)
18:09:57 × MajorBiscuit quits (~MajorBisc@2a02:a461:129d:1:193d:75d8:745d:e91e) (Ping timeout: 240 seconds)
18:10:29 × k8yun_ quits (~k8yun@198-48-158-40.cpe.pppoe.ca) (Ping timeout: 250 seconds)
18:12:03 mc47 joins (~mc47@xmonad/TheMC47)
18:15:20 flinner joins (~flinner__@2001:16a2:7826:a700:3836:77fb:c833:2a56)
18:15:20 × flinner quits (~flinner__@2001:16a2:7826:a700:3836:77fb:c833:2a56) (Changing host)
18:15:20 flinner joins (~flinner__@user/flinner)
18:15:37 × mon_aaraj quits (~MonAaraj@user/mon-aaraj/x-4416475) (Ping timeout: 240 seconds)
18:17:51 mon_aaraj joins (~MonAaraj@user/mon-aaraj/x-4416475)
18:17:52 × Jing quits (~hedgehog@240e:390:7c53:a7e1:d8d5:ad63:210:577a) (Quit: My MacBook has gone to sleep. ZZZzzz…)
18:18:11 × mikoto-chan quits (~mikoto-ch@213.177.151.239) (Ping timeout: 256 seconds)
18:18:51 × `2jt quits (~jtomas@130.red-88-22-46.staticip.rima-tde.net) (Ping timeout: 256 seconds)
18:19:39 pretty_dumm_guy joins (trottel@gateway/vpn/protonvpn/prettydummguy/x-88029655)
18:20:37 mikoto-chan joins (~mikoto-ch@213.177.151.239)
18:21:29 × zmt00 quits (~zmt00@user/zmt00) (Ping timeout: 252 seconds)
18:22:04 × zincy quits (~zincy@host86-151-99-97.range86-151.btcentralplus.com) (Remote host closed the connection)
18:22:25 zmt00 joins (~zmt00@user/zmt00)
18:23:16 × mon_aaraj quits (~MonAaraj@user/mon-aaraj/x-4416475) (Ping timeout: 245 seconds)
18:24:11 mon_aaraj joins (~MonAaraj@user/mon-aaraj/x-4416475)
18:24:42 × Vajb quits (~Vajb@hag-jnsbng11-58c3a8-176.dhcp.inet.fi) (Read error: Connection reset by peer)
18:25:45 × fef quits (~thedawn@user/thedawn) (Ping timeout: 276 seconds)
18:25:56 Vajb joins (~Vajb@hag-jnsbng11-58c3a8-176.dhcp.inet.fi)
18:26:02 × dyeplexer quits (~dyeplexer@user/dyeplexer) (Remote host closed the connection)
18:27:42 × alMalsamo quits (~alMalsamo@gateway/tor-sasl/almalsamo) (Ping timeout: 276 seconds)
18:30:06 × mon_aaraj quits (~MonAaraj@user/mon-aaraj/x-4416475) (Remote host closed the connection)
18:30:41 mon_aaraj joins (~MonAaraj@user/mon-aaraj/x-4416475)
18:31:26 <texasmynsted> okay, I will also try just Megaparsec for the whole file. The problem I see is that while they data I am looking for will always be in the file, it may not always be in the same place.
18:32:07 <texasmynsted> Maybe that does not matter.
18:33:24 alMalsamo joins (~alMalsamo@gateway/tor-sasl/almalsamo)
18:36:00 <texasmynsted> as for the parsec flavours, I just picked megaparsec to eliminate one choice, heh.
18:36:19 × mon_aaraj quits (~MonAaraj@user/mon-aaraj/x-4416475) (Ping timeout: 256 seconds)
18:37:26 <sm> good choice
18:37:35 mon_aaraj joins (~MonAaraj@user/mon-aaraj/x-4416475)
18:37:58 <sm> don't neglect its excellent docs
18:39:05 <texasmynsted> I just wish I could find a page somewhere with a kind of hello-world for parsing an entire "unstructured" file.
18:39:06 <sm> and, be patient: parser combinators are easy to get started with but it takes a little while to learn how to use them effectively for larger parsers
18:39:40 <texasmynsted> my use case is a replacement for awk
18:40:03 <texasmynsted> Quickly search through a file looking for the 3-5 things I need.
18:40:12 <sm> do you want to build one, or just use one ? does it have to be written in haskell ?
18:41:38 <sm> did you see https://hackage.haskell.org/package/haskell-awk and https://hackage.haskell.org/package/hwk ?
18:41:42 <texasmynsted> I would use one but _reason_ I am doing it is that I want to avoid regular expressions, and leverage/learn/keep-skills-sharp FP techniques
18:42:13 <texasmynsted> oh yeah... Let me check that out.
18:42:47 zincy joins (~zincy@2a00:23c8:970c:4801:68f0:cbbd:5b77:19e4)
18:43:33 <texasmynsted> :-)
18:43:47 <texasmynsted> That might be just the thing for this use case.
18:43:50 <texasmynsted> Thank you
18:43:56 <sm> np
18:44:05 <sshine> absentia, one thing I like about Megaparsec (there's more than one thing) is Mark's redesign of makeExprParser: https://hackage.haskell.org/package/parser-combinators-1.3.0/docs/Control-Monad-Combinators-Expr.html#v:makeExprParser
18:44:48 × eggplantade quits (~Eggplanta@2600:1700:bef1:5e10:1dc4:f5c4:a458:81) (Remote host closed the connection)
18:46:25 <hololeap> texasmynsted: for parsing a file where the structure may be rearranged, the chioce function (aka asum) is what you want to use
18:46:52 <hololeap> *choice
18:47:02 <texasmynsted> asum? is that a megaparsec thing.
18:47:15 <ski> @index asum
18:47:15 <lambdabot> Data.Foldable
18:47:39 <hololeap> no, it's an Alternative thing. choice is from parser-combinators
18:47:41 <ski> @type asum
18:47:42 <lambdabot> (Foldable t, Alternative f) => t (f a) -> f a
18:48:10 <texasmynsted> oh :-)
18:48:14 <hololeap> choice is just a different (better IMO) name for asum
18:48:21 <texasmynsted> I see Mark mentions it here also -> https://markkarpov.com/tutorial/megaparsec.html
18:48:53 <ski> @type foldr (<|>) empty
18:48:54 <lambdabot> (Foldable t, Alternative f) => t (f a) -> f a
18:49:33 <texasmynsted> ooh I see
18:49:52 <hololeap> texasmynsted: if you give me an example of some input and what you want to extract, I can show you an example of how to parse it with megaparsec
18:50:05 <texasmynsted> Okay, I suppose parsing an unstructured file should be no big deal then
18:50:05 <ski> `choice' is more specific to a particular way of thinking about `Alternative'
18:51:24 <texasmynsted> "BILLING PERIOD" and "Total:" and "Date:"
18:52:34 ski 'sn't sure what "unstructured" would mean, in this context
18:53:52 <texasmynsted> What I mean is that these are PDF files that I scrape the text out of. They are largely handwritten so while one person may use the same field names, they may not always be in the same place.
18:54:03 <texasmynsted> There might be comments, descriptions, questions, etc.
18:54:43 × mc47 quits (~mc47@xmonad/TheMC47) (Remote host closed the connection)
18:54:52 <hololeap> is there any structure to what the "BILLING PERIOD" format is, for example?
18:54:59 <texasmynsted> There is no enforced semantics; these are not JSON, YAML, CSV, XML, etc.
18:55:38 <texasmynsted> The billing period is plain text after the key "BILLING PERIOD" in all caps.
18:55:55 <texasmynsted> It is the rest of the line
18:55:57 <ski> mhm
18:56:25 <texasmynsted> This flexibility makes this more . . . fun
18:57:07 <hololeap> ok, but is the plain text billing period format consistent, or can it be anything?
18:57:11 <texasmynsted> another piece of this is there are many sources of these documents. Each source has the same key fields but they are described differently.
18:57:49 <texasmynsted> So once I build a parser for one source, I will need to build another one for the second source, and so on.
18:58:33 <texasmynsted> I have another problem like this that I want to prime myself to solve. The other problem is like this but far more complicated.
18:59:16 <texasmynsted> Using a parser combinator lib I should be able to re-use some of my work from prior parsers. (I would hope.)
19:01:17 <texasmynsted> hololeap: it can be anything.
19:01:40 <texasmynsted> Mostly it is like Jan 1 - Jan 15
19:02:00 <texasmynsted> For my purposes, this is fine.
19:02:15 <texasmynsted> So long as I capture it, I am good.
19:03:05 <texasmynsted> I am going to populate a CSV with the data. It is fine for this if the fields are not machine readable.
19:03:26 <texasmynsted> Just the right data in the right place, most of the time.
19:05:24 × gehmehgeh quits (~user@user/gehmehgeh) (Ping timeout: 276 seconds)
19:06:07 gehmehgeh joins (~user@user/gehmehgeh)
19:08:57 × deadmarshal quits (~deadmarsh@95.38.112.249) (Ping timeout: 240 seconds)
19:12:05 Sgeo joins (~Sgeo@user/sgeo)
19:12:41 Null_A joins (~null_a@2601:645:8700:2290:dcf9:b60:3266:d217)
19:14:52 × _xor quits (~xor@dsl-50-5-233-169.fuse.net) (Read error: Connection reset by peer)
19:19:42 _xor joins (~xor@dsl-50-5-233-169.fuse.net)
19:21:59 ProfSimm joins (~ProfSimm@87.227.196.109)
19:26:45 eugen[m] parts (~eugenrahr@2001:470:69fc:105::1:a153) ()
19:30:15 AlexNoo joins (~AlexNoo@94.233.241.94)
19:30:20 eggplantade joins (~Eggplanta@2600:1700:bef1:5e10:1dc4:f5c4:a458:81)
19:31:17 <energizer> if i have a B of As and I want an A of Bs, like list of tuples -> tuple of lists, is there a name for that operation in general?
19:32:03 Topsi joins (~Tobias@dyndsl-095-033-093-001.ewe-ip-backbone.de)
19:32:12 `2jt joins (~jtomas@130.red-88-22-46.staticip.rima-tde.net)
19:32:39 merijn joins (~merijn@c-001-001-018.client.esciencecenter.eduvpn.nl)
19:33:45 <monochrom> traverse comes close but it comes with conditions.
19:33:49 <monochrom> @type traverse
19:33:50 <lambdabot> (Traversable t, Applicative f) => (a -> f b) -> t a -> f (t b)
19:33:55 <monochrom> Err, sequence
19:33:56 <awpr> traverse or distribute, depending on whether you want to stitch together many of the inner type or extract many "slices" from the outer type. caveat: "lists of tuple*s*" doesn't fit well into either of these
19:34:00 <monochrom> @type sequence
19:34:00 <lambdabot> (Traversable t, Monad m) => t (m a) -> m (t a)
19:34:08 <awpr> err, sequence or distribute :D
19:35:55 <hololeap> texasmynsted: this is what I came up with. I haven't tested it: https://dpaste.com/CQC3SHWGK
19:35:55 <energizer> @type distribute
19:35:56 <lambdabot> error:
19:35:56 <lambdabot> • Variable not in scope: distribute
19:35:57 <lambdabot> • Perhaps you meant ‘distrib’ (imported from Control.Lens)
19:36:25 <energizer> @type distrib
19:36:26 <lambdabot> (Conjoined p, Functor f) => p a b -> p (f a) (f b)
19:36:48 <energizer> that doesnt look related
19:36:51 <awpr> "lists of tuples" specifically in the form of `[(a, b)]` and `([a], [b])` is actually unzip, which doesn't map to either of them
19:36:59 × k8yun__ quits (~k8yun@24.244.29.99) (Quit: Leaving)
19:37:11 <awpr> it's not; https://hackage.haskell.org/package/distributive-0.6.2.1/docs/Data-Distributive.html#t:Distributive
19:39:30 <awpr> `sequence` is like: iterate through the outer structure according to `Traversable`, and glue together all the inner structures according to their `Applicative`
19:39:30 <awpr> `distribute` is like: create a version of the inner structure from thin air by its `Distributive`, and populate it by extracting slices of the outer structure with its `Functor`
19:40:38 × flinner quits (~flinner__@user/flinner) (Ping timeout: 250 seconds)
19:41:05 <awpr> you can turn the list-of-tuples thing into something Distributive-shaped by using `data Pair a = Pair a a` instead, and then `distribute :: [Pair a] -> Pair [a]`
19:43:19 × geekosaur quits (~geekosaur@xmonad/geekosaur) (Remote host closed the connection)
19:44:11 <texasmynsted> hololeap: Thank you!
19:45:10 geekosaur joins (~geekosaur@xmonad/geekosaur)
19:45:26 <texasmynsted> That really helps. I will try this out. One bit I found is that there is a large variation on the amount of whitespace between the key, like "Total:", and the value.
19:46:17 <texasmynsted> I see you throw out a space with _ <- space.
19:48:49 <texasmynsted> So I will simply need to find a way to ignore any number of spaces. This is fairly simple to describe with regexp. I will checkout skipManyTill and your `takeUntilEOL`.
19:49:45 <sshine> texasmynsted, is this Parsec, Megaparsec, or something third?
19:50:39 <monochrom> "many space" throws out a lot of spaces. "some space" too.
19:51:34 <monochrom> But I thought you didn't want regexes.
19:51:36 <texasmynsted> Megaparsec
19:51:38 Sqaure parts (~a@user/square) (Leaving)
19:51:51 <texasmynsted> I do not want regexes
19:53:33 <hololeap> texasmynsted: space from Text.Megaparsec.Char throws out any number of spaces
19:53:44 alp joins (~alp@user/alp)
19:54:00 <texasmynsted> I see --> https://hackage.haskell.org/package/base-4.16.0.0/docs/Control-Applicative.html#v:some
19:54:05 <hololeap> > Skip zero or more white space characters.
19:54:20 <texasmynsted> hololeap: Oh okay.
19:54:53 <texasmynsted> :-) This looks like it is going to a great learning experience! Thank you!
19:55:30 <hololeap> well, it doesn't throw it out normally, but it does when you use `_ <- space`
19:55:47 <texasmynsted> got it
19:55:55 AlexZenon joins (~alzenon@94.233.241.94)
19:56:00 <texasmynsted> It is capturing it to the hole
19:56:00 Alex_test joins (~al_test@94.233.241.94)
19:56:02 <texasmynsted> _
19:56:10 <hololeap> oh wait... no it _does_ throw it out
19:56:21 <hololeap> so `_ <- space` is unnecessary
19:56:23 <hololeap> https://hackage.haskell.org/package/megaparsec-9.2.0/docs/Text-Megaparsec-Char.html#v:space
19:56:39 <hololeap> it could just be `space`
19:56:54 <hololeap> either way works
19:56:55 <texasmynsted> :-) Cool!
19:56:59 <absentia> @type (>>=)
19:57:00 <lambdabot> Monad m => m a -> (a -> m b) -> m b
19:57:03 <absentia> @type (>>)
19:57:03 <lambdabot> Monad m => m a -> m b -> m b
19:57:16 <monochrom> "_ <-" is probably written by people who turn on -Wall -Werror
19:57:20 <absentia> notice in the continuation how the value of type `a` is not provided
19:57:29 <absentia> you just throw away the result of the previous monadic action
19:57:51 <hololeap> monochrom: -Wall is how I got into that habit :)
19:57:59 <absentia> why is that -Wall
19:58:26 <absentia> you're not binding the monadic value which might be a typo?
19:58:35 × hyiltiz quits (~quassel@31.220.5.250) (Ping timeout: 256 seconds)
19:59:57 <absentia> i clearly did not read the previous discussion
20:01:29 shailangsa joins (~shailangs@host86-185-98-37.range86-185.btcentralplus.com)
20:03:03 hyiltiz joins (~quassel@31.220.5.250)
20:03:34 <hololeap> absentia: https://downloads.haskell.org/ghc/8.10.6/docs/html/users_guide/using-warnings.html#ghc-flag--Wunused-do-bind
20:03:50 × mon_aaraj quits (~MonAaraj@user/mon-aaraj/x-4416475) (Ping timeout: 260 seconds)
20:04:19 <absentia> hololeap: thanks, figured it would be something like that
20:04:20 yauhsien joins (~yauhsien@61-231-25-133.dynamic-ip.hinet.net)
20:04:36 <hololeap> but I guess it's not actually in -Wall, at least not in this version of GHC
20:04:44 absentia checks his compiler flags
20:05:05 <absentia> hmmmm
20:05:23 × juhp quits (~juhp@128.106.188.82) (Ping timeout: 256 seconds)
20:05:46 × alp quits (~alp@user/alp) (Ping timeout: 245 seconds)
20:05:55 mon_aaraj joins (~MonAaraj@user/mon-aaraj/x-4416475)
20:06:31 × merijn quits (~merijn@c-001-001-018.client.esciencecenter.eduvpn.nl) (Ping timeout: 256 seconds)
20:06:42 juhp joins (~juhp@128.106.188.82)
20:07:04 × zincy quits (~zincy@2a00:23c8:970c:4801:68f0:cbbd:5b77:19e4) (Remote host closed the connection)
20:07:06 <hololeap> often times I'll use -Weverything and then disable warnings I don't want, ala https://medium.com/mercury-bank/enable-all-the-warnings-a0517bc081c3
20:08:41 × yauhsien quits (~yauhsien@61-231-25-133.dynamic-ip.hinet.net) (Ping timeout: 256 seconds)
20:08:53 <absentia> I have negative ints out of unsigned range warnings
20:08:58 <absentia> I can't remember if these are mistakes or evil bit sorcery
20:15:48 <energizer> awpr: is it fair to say, in the language of "data-oriented design", distribute is like array of struct -> struct of array and sequence is like struct of array -> array of struct
20:17:10 <absentia> @type sequence
20:17:11 <lambdabot> (Traversable t, Monad m) => t (m a) -> m (t a)
20:17:24 <absentia> energizer: in some sense yes you are inverting the structure
20:17:34 <absentia> but you need not fix yourself to `struct` or `array`
20:17:37 <hololeap> distribute needs the inner functor to be Distributive, which means it has to be isomorphic to (Reader r)
20:17:49 <absentia> anything traversable and monadic
20:18:26 <absentia> "i have a structure of monadic actions. traverse the entire structure, execute each action, and give me a monadic action that returns a structure of the results"
20:18:39 Akiva joins (~Akiva@user/Akiva)
20:19:10 <monochrom> And Reader r is isomorphic to "arrays with index type r" :)
20:19:12 <awpr> as other people have said, that drops all the generality of both functions and reduces them to one; but beyond that, that's only true if "array" and "struct" mean the same thing and "distribute" and "traverse" turn out to be the same function
20:19:30 × bitdex quits (~bitdex@gateway/tor-sasl/bitdex) (Ping timeout: 276 seconds)
20:19:43 <hololeap> in practice Distributive usually means something with a single constructor and a single type variable, like Identity, Sum, Product, etc
20:19:44 <monochrom> https://link.springer.com/chapter/10.1007/978-3-662-54434-1_21
20:20:15 <awpr> ("struct" -> would have to have all fields of the same type; and "array" would have to be fixed-length with the zip-style Applicative instance)
20:21:06 <absentia> (if it helps think of "monadic action" as "computation")
20:21:20 <absentia> a serial computation, a parallel computation, a non-determinstic computation...
20:21:30 <awpr> more generally structs with diverse field types would not be applicable to either sequenceA or distribute, and sequenceA would take variable-length lists to their cartesian products
20:21:36 <EvanR> does any of this have to do with representable functors... I should learn what representable functors are about
20:21:41 bitdex joins (~bitdex@gateway/tor-sasl/bitdex)
20:22:04 <awpr> yes, Distributive and Representable are different expressions of the same concept
20:22:10 <hololeap> yeah "isomorphic to (Reader r)" is the definition of a representable functor
20:22:20 <energizer> "Categorically every Distributive functor is actually a right adjoint, and so it must be Representable endofunctor and preserve all limits. This is a fancy way of saying it is isomorphic to (->) x for some x."
20:22:24 zincy joins (~zincy@2a00:23c8:970c:4801:68f0:cbbd:5b77:19e4)
20:22:36 <monochrom> Yes. F is representable iff there is an object r such that there is natural isomorphism between F and Reader r.
20:23:44 <hololeap> ^ precise
20:24:02 <EvanR> I see
20:24:15 <monochrom> And the people who say "Naperian" instead will say that r is the logarithm of F because r->x is like x^r and you're looking at "F(x) = x^r, I want to find r".
20:24:35 <EvanR> I see
20:26:11 <EvanR> sum types, product types, exponential types, log types xD
20:26:23 <monochrom> Now see my link to the nice Gibbons paper that uses this and Traversable to explain APL :)
20:26:39 <EvanR> I saw the naperian functors papers a while back was cool
20:26:48 <EvanR> didn't know how it linked into anything I already knew, until now
20:26:56 <awpr> incidentally the "Naperian" presentation is the one that lets you use it as "struct-of-vectors" -> "vector-of-structs"
20:27:40 <EvanR> *so basically it's just a container* hides
20:28:18 <awpr> statically-shaped container (not necessarily finite) is actually a pretty good intuition for Representables IMO
20:28:51 <EvanR> (also, r -> _ considered as a container, if it didn't already make sense, this is how it makes sense)
20:29:10 PokeyCat joins (~PokeyCat@cpe-24-55-0-112.austin.res.rr.com)
20:29:31 <monochrom> I go the last step and say <monochrom> And Reader r is isomorphic to "arrays with index type r" :)
20:29:47 <monochrom> array. Accept no substitute!
20:30:18 <hololeap> well, arrays with a known size
20:30:29 <EvanR> before it's an array, you must choose an embedding of r into the euclidean plane
20:30:40 <EvanR> so we know how to arrange stuff in space
20:31:00 <EvanR> make sure it's a horizontal arrangement
20:32:01 wroathe joins (~wroathe@206-55-188-8.fttp.usinternet.com)
20:32:01 × wroathe quits (~wroathe@206-55-188-8.fttp.usinternet.com) (Changing host)
20:32:01 wroathe joins (~wroathe@user/wroathe)
20:32:26 <hololeap> % :t tablulate -- this is the tricky one which requires the structure to be fixed
20:32:26 <yahb> hololeap: ; <interactive>:1:1: error:; * Variable not in scope: tablulate; * Perhaps you meant one of these: `tabulate' (imported from Data.Functor.Rep), `Q.tabulate' (imported from Test.QuickCheck), `gtabulate' (imported from Data.Functor.Rep)
20:32:34 <EvanR> (I mean, how else do you comprehend an array. O(1) performance? xD)
20:32:42 <hololeap> % :m + Data.Functor.Rep
20:32:42 <yahb> hololeap:
20:32:48 <hololeap> % :t tablulate
20:32:48 <yahb> hololeap: ; <interactive>:1:1: error:; * Variable not in scope: tablulate; * Perhaps you meant one of these: `tabulate' (imported from Data.Functor.Rep), `Q.tabulate' (imported from Test.QuickCheck), `gtabulate' (imported from Data.Functor.Rep)
20:33:01 <awpr> https://en.wikipedia.org/wiki/Container_(type_theory) even goes as far as to say a container is a sum type of many Representables, if you reorganize the concepts slightly
20:33:05 <hololeap> % :t tabulate -- derp
20:33:05 <yahb> hololeap: Representable f => (Rep f -> a) -> f a
20:34:08 taylorswift2018 joins (~taylorswi@115-188-158-33-fibre.sparkbb.co.nz)
20:34:52 Sqaure joins (~a@user/square)
20:35:26 × eggplantade quits (~Eggplanta@2600:1700:bef1:5e10:1dc4:f5c4:a458:81) (Remote host closed the connection)
20:36:05 Pirate18 joins (~Pirate18@72-46-55-28.lnk.ne.static.allophone.net)
20:36:47 × wroathe quits (~wroathe@user/wroathe) (Ping timeout: 256 seconds)
20:37:47 × Topsi quits (~Tobias@dyndsl-095-033-093-001.ewe-ip-backbone.de) (Read error: Connection reset by peer)
20:39:15 × PokeyCat quits (~PokeyCat@cpe-24-55-0-112.austin.res.rr.com) (Remote host closed the connection)
20:39:35 eggplantade joins (~Eggplanta@2600:1700:bef1:5e10:1dc4:f5c4:a458:81)
20:39:35 cynomys joins (~cynomys@user/cynomys)
20:40:05 whatsupdoc joins (uid509081@id-509081.hampstead.irccloud.com)
20:40:56 <EvanR> a perfect binary tree is an array of size 2^n, programmers think the second one is more concrete, but the first one is how RAM is constructed xD
20:42:00 <monochrom> If you relax from binary to a hardware-dependent base then yes.
20:42:27 <EvanR> or maybe mixed base
20:43:11 <monochrom> And yes they even have the term "linear address model". The irony that this is just a model and nowhere near the bare "metal" is totally lost.
20:43:30 <[exa]> o blocks, o caches
20:44:05 <monochrom> And the irony that semiconductors are nowhere near metal is also totally lost.
20:44:14 <EvanR> lol
20:44:15 <[exa]> o silicon
20:44:22 Erutuon joins (~Erutuon@user/erutuon)
20:44:41 <monochrom> Shows you how much programmers are living in their own reality distortion fields.
20:44:46 <Rembane> Are semiconductors more like porcelain?
20:44:47 <EvanR> shiny https://en.wikipedia.org/wiki/Silicon#/media/File:SiliconCroda.jpg
20:46:26 <EvanR> it's also literally "near metal" (aluminum) on the periodic table
20:46:32 <monochrom> If you go back to the 1940s of using relays for logic gates, now that would be honest about "bare metal".
20:47:25 <monochrom> Now see Shannon's nice Msc thesis on thinking in terms of logic gates in the first place! https://www.cs.virginia.edu/~evans/greatworks/shannon38.pdf
20:50:15 <dolio> This is such a ridiculous complaint.
20:50:17 × emf quits (~emf@2620:10d:c090:400::5:ab3f) (Ping timeout: 240 seconds)
20:51:03 × _ht quits (~quassel@231-169-21-31.ftth.glasoperator.nl) (Remote host closed the connection)
20:51:42 emf joins (~emf@2620:10d:c090:400::5:ab3f)
20:56:10 Hash joins (~Hash@hashsecurity.org)
20:58:40 deadmarshal joins (~deadmarsh@95.38.112.249)
21:01:13 pavonia joins (~user@user/siracusa)
21:02:37 × xff0x quits (~xff0x@2001:1a81:52c7:8c00:f773:af87:1684:89e3) (Ping timeout: 240 seconds)
21:03:05 × deadmarshal quits (~deadmarsh@95.38.112.249) (Ping timeout: 256 seconds)
21:03:41 xff0x joins (~xff0x@2001:1a81:52c7:8c00:38b7:f9c0:eacd:8def)
21:05:22 lavaman joins (~lavaman@98.38.249.169)
21:09:29 shreyasminocha joins (51fdc93eda@user/shreyasminocha)
21:17:58 cjb joins (~cjb@user/cjb)
21:18:08 × mon_aaraj quits (~MonAaraj@user/mon-aaraj/x-4416475) (Ping timeout: 250 seconds)
21:20:16 mon_aaraj joins (~MonAaraj@user/mon-aaraj/x-4416475)
21:20:27 × lavaman quits (~lavaman@98.38.249.169) (Remote host closed the connection)
21:23:17 × mikoto-chan quits (~mikoto-ch@213.177.151.239) (Ping timeout: 240 seconds)
21:28:26 <EvanR> This sentence is such a ridiculous complaint
21:29:44 × Null_A quits (~null_a@2601:645:8700:2290:dcf9:b60:3266:d217) (Remote host closed the connection)
21:32:02 wyrd joins (~wyrd@gateway/tor-sasl/wyrd)
21:36:49 sheb joins (~sheb@31.223.228.71)
21:38:18 <d34df00d> This sentence is false.
21:41:39 Constraintegic joins (~thomasbul@2001:a61:1366:3201:de74:893f:6e5d:3ce1)
21:42:35 × zer0bitz quits (~zer0bitz@2001:2003:f74d:b800:90d6:f3c8:741b:677a) (Ping timeout: 250 seconds)
21:43:16 × mon_aaraj quits (~MonAaraj@user/mon-aaraj/x-4416475) (Ping timeout: 250 seconds)
21:45:22 mon_aaraj joins (~MonAaraj@user/mon-aaraj/x-4416475)
21:47:48 × cosimone quits (~user@2001:b07:ae5:db26:c24a:d20:4d91:1e20) (Remote host closed the connection)
21:48:50 cosimone joins (~user@2001:b07:ae5:db26:c24a:d20:4d91:1e20)
21:49:45 lavaman joins (~lavaman@98.38.249.169)
21:49:49 × lavaman quits (~lavaman@98.38.249.169) (Remote host closed the connection)
21:50:22 lavaman joins (~lavaman@98.38.249.169)
21:51:01 × mon_aaraj quits (~MonAaraj@user/mon-aaraj/x-4416475) (Ping timeout: 256 seconds)
21:51:41 mon_aaraj joins (~MonAaraj@user/mon-aaraj/x-4416475)
21:53:37 × Constraintegic quits (~thomasbul@2001:a61:1366:3201:de74:893f:6e5d:3ce1) (Quit: Leaving)
21:54:31 × raehik quits (~raehik@cpc95906-rdng25-2-0-cust156.15-3.cable.virginm.net) (Ping timeout: 250 seconds)
21:54:37 × takuan quits (~takuan@178-116-218-225.access.telenet.be) (Remote host closed the connection)
21:54:55 raehik joins (~raehik@cpc95906-rdng25-2-0-cust156.15-3.cable.virginm.net)
21:54:58 × lavaman quits (~lavaman@98.38.249.169) (Ping timeout: 250 seconds)
21:55:41 <Pirate18> I've got an expensive Rand StdGen A and want to generate a large # of As from it, preferably concurrently. What would be the best way to do that? Right now I spawn numCapabilities threads that repeatedly generate one (using runRand) and pass it to a single consumer thread with an MVar.
21:56:19 <wavemode> why's it so expensive
21:56:50 <Pirate18> It's a monte-carlo simulation that runs several thousand steps to produce a result
21:59:48 <hololeap> so is each step of the StdGen getting salted with this expensive computation, or the computation just used to initialize it?
22:01:54 × CiaoSen quits (~Jura@p200300c95737a2002a3a4dfffe84dbd5.dip0.t-ipconnect.de) (Ping timeout: 260 seconds)
22:02:09 <Pirate18> Right now I call newStdGen once per thread, and thread that StdGen through each iteration. Getting a new StdGen each time (with evalRandIO instead of runRand) ended up being slower.
22:02:14 <ski> Pirate18 : you're `split'ting at time of spawn ?
22:02:20 <ski> oh, `newStdGen'
22:02:38 <Pirate18> effectively the same I think
22:02:54 <ski> well, `newStdGen' mutates the global `StdGen'
22:03:07 merijn joins (~merijn@c-001-001-018.client.esciencecenter.eduvpn.nl)
22:03:08 <ski> so, perhaps if you only did `newStdGen' once ?
22:03:40 <hololeap> mutating the global StdGen probably isn't a bad thing
22:03:45 <Pirate18> I could but I'm only calling newStdGen once per thread so that's not going to be the bottleneck
22:04:14 <ski> oh right, only `numCapabilities' threads
22:04:52 <hololeap> I don't know if there is a better approach than what you're doing, Pirate18
22:05:41 <EvanR> calling newStdGen once per number doesn't sound right
22:05:57 × fendor quits (~fendor@178.115.78.100.wireless.dyn.drei.com) (Remote host closed the connection)
22:06:22 <EvanR> nvm, once per capability
22:07:05 × `2jt quits (~jtomas@130.red-88-22-46.staticip.rima-tde.net) (Ping timeout: 250 seconds)
22:07:07 <Pirate18> OK. I've made/fixed a few dumb mistakes so far (like not cleaning up the worker threads) so wanted to double-check I wasn't missing a library that made it simple, in addition to anything that would speed it up of course.
22:07:25 <Pirate18> Thanks for the help
22:07:31 × jonathanx_ quits (~jonathan@h-178-174-176-109.A357.priv.bahnhof.se) (Remote host closed the connection)
22:07:34 jonathanx joins (~jonathan@h-178-174-176-109.A357.priv.bahnhof.se)
22:07:37 <hololeap> you could use the stuff in the parallel package
22:07:42 <EvanR> I hear the stdgen rng from base isn't the highest performance RNG in the world
22:07:53 <EvanR> there are many to choose from on hackage
22:08:10 <monochrom> base doesn't have it (or any random story) any more.
22:08:19 <EvanR> orly
22:08:29 <monochrom> The random package uses the splixmix package, which is pretty fast.
22:08:43 <monochrom> err splitmix
22:08:51 <wavemode> how are the worker threads passing the numbers to the consumer thread? a concurrent queue might be the best way
22:09:27 <hololeap> they probably each just generate N numbers as a batch job
22:09:32 <Pirate18> Just an MVar right now because the consumer is much faster than all the producers, I haven't benchmarked a queue against it yet though.
22:11:05 <Pirate18> Alright I've got a few things to benchmark now, thanks!
22:11:58 × wyrd quits (~wyrd@gateway/tor-sasl/wyrd) (Remote host closed the connection)
22:12:06 wyrd joins (~wyrd@gateway/tor-sasl/wyrd)
22:13:52 <EvanR> N threads are producing random numbers in parallel and pushing to the same MVar, where 1 thread is taking and using them? Interesting, I guess if they are properly random the result is also random
22:14:15 × zincy quits (~zincy@2a00:23c8:970c:4801:68f0:cbbd:5b77:19e4) (Remote host closed the connection)
22:14:44 <EvanR> it's not obvious how to show that doing that is still random, to me
22:15:54 <EvanR> N rngs + the "randomness" of the scheduler...
22:15:57 × bontaq quits (~user@ool-45779fe5.dyn.optonline.net) (Ping timeout: 250 seconds)
22:17:09 <hololeap> if you start with a random value and iterate it through a PRNG N times, does it lose its randomness at some point?
22:17:52 <monochrom> No, but you hit periodicity at some point.
22:18:04 <EvanR> meaning, a random seed
22:18:18 <monochrom> Oh wait you mean something else.
22:18:39 <EvanR> iterate *it* through an RNG = just run the RNG?
22:19:34 <monochrom> This is why most PRNGs don't let you really do that. The seed type is usually much wider than the output type.
22:19:47 × eggplantade quits (~Eggplanta@2600:1700:bef1:5e10:1dc4:f5c4:a458:81) (Remote host closed the connection)
22:20:04 <EvanR> the state type
22:20:12 wroathe joins (~wroathe@206-55-188-8.fttp.usinternet.com)
22:20:12 × wroathe quits (~wroathe@206-55-188-8.fttp.usinternet.com) (Changing host)
22:20:12 wroathe joins (~wroathe@user/wroathe)
22:21:06 × werneta quits (~werneta@70-142-214-115.lightspeed.irvnca.sbcglobal.net) (Remote host closed the connection)
22:24:57 × wroathe quits (~wroathe@user/wroathe) (Ping timeout: 240 seconds)
22:25:27 <EvanR> all numbers are equally random, but something about macrovariable values correspond to different number of microstates
22:25:28 × cosimone quits (~user@2001:b07:ae5:db26:c24a:d20:4d91:1e20) (Remote host closed the connection)
22:26:06 cosimone joins (~user@2001:b07:ae5:db26:c24a:d20:4d91:1e20)
22:26:10 × xff0x quits (~xff0x@2001:1a81:52c7:8c00:38b7:f9c0:eacd:8def) (Ping timeout: 260 seconds)
22:26:53 xff0x joins (~xff0x@2001:1a81:52c7:8c00:e8ce:cafa:8529:c63a)
22:28:45 × gehmehgeh quits (~user@user/gehmehgeh) (Quit: Leaving)
22:35:03 monaaraj joins (~MonAaraj@user/mon-aaraj/x-4416475)
22:35:13 × mon_aaraj quits (~MonAaraj@user/mon-aaraj/x-4416475) (Ping timeout: 256 seconds)
22:37:09 × merijn quits (~merijn@c-001-001-018.client.esciencecenter.eduvpn.nl) (Ping timeout: 256 seconds)
22:37:15 werneta joins (~werneta@70-142-214-115.lightspeed.irvnca.sbcglobal.net)
22:37:44 RFV joins (~Thunderbi@187.red-88-13-186.dynamicip.rima-tde.net)
22:37:48 × burnside_ quits (~burnsides@dhcp168-015.wadham.ox.ac.uk) (Remote host closed the connection)
22:38:21 burnsidesLlama joins (~burnsides@dhcp168-015.wadham.ox.ac.uk)
22:40:21 × RFV quits (~Thunderbi@187.red-88-13-186.dynamicip.rima-tde.net) (Client Quit)
22:41:19 × cosimone quits (~user@2001:b07:ae5:db26:c24a:d20:4d91:1e20) (Remote host closed the connection)
22:42:17 × burnsidesLlama quits (~burnsides@dhcp168-015.wadham.ox.ac.uk) (Ping timeout: 240 seconds)
22:47:10 oscurochu joins (~oscurochu@097-096-050-227.res.spectrum.com)
22:50:00 xcmw joins (~textual@071-087-004-073.biz.spectrum.com)
22:50:16 × __monty__ quits (~toonn@user/toonn) (Quit: leaving)
22:57:33 × raehik quits (~raehik@cpc95906-rdng25-2-0-cust156.15-3.cable.virginm.net) (Ping timeout: 256 seconds)
22:59:25 raehik joins (~raehik@cpc95906-rdng25-2-0-cust156.15-3.cable.virginm.net)
23:00:37 × emf quits (~emf@2620:10d:c090:400::5:ab3f) (Ping timeout: 240 seconds)
23:09:24 burnsidesLlama joins (~burnsides@dhcp168-015.wadham.ox.ac.uk)
23:13:14 × burnsidesLlama quits (~burnsides@dhcp168-015.wadham.ox.ac.uk) (Remote host closed the connection)
23:13:21 burnsidesLlama joins (~burnsides@dhcp168-015.wadham.ox.ac.uk)
23:16:42 lavaman joins (~lavaman@98.38.249.169)
23:17:43 × MochizukisLastTh quits (~Mochizuki@112-68-46-13f1.osk2.eonet.ne.jp) (Ping timeout: 256 seconds)
23:20:11 eggplantade joins (~Eggplanta@2600:1700:bef1:5e10:1dc4:f5c4:a458:81)
23:20:57 × lavaman quits (~lavaman@98.38.249.169) (Ping timeout: 240 seconds)
23:21:21 × tcard_ quits (~tcard@p2878075-ipngn18701hodogaya.kanagawa.ocn.ne.jp) (Quit: Leaving)
23:23:37 Null_A joins (~null_a@2601:645:8700:2290:dcf9:b60:3266:d217)
23:24:15 MochizukisLastTh joins (~Mochizuki@112-68-46-13f1.osk2.eonet.ne.jp)
23:24:17 × eggplantade quits (~Eggplanta@2600:1700:bef1:5e10:1dc4:f5c4:a458:81) (Ping timeout: 240 seconds)
23:27:33 <sm> Data.Char.isAlphaNum, y'all. What weird Unicode demons might lurk inside it ?
23:28:06 <sm> https://hackage.haskell.org/package/base-4.16.0.0/docs/Data-Char.html#v:isAlphaNum
23:28:06 <sm> "Selects alphabetic or numeric Unicode characters. ... numeric digits outside the ASCII range, as well as numeric characters which aren't digits, are selected by this function ..."
23:28:11 tcard joins (~tcard@p2878075-ipngn18701hodogaya.kanagawa.ocn.ne.jp)
23:28:42 <maerwald> lolz
23:28:58 × [itchyjunk] quits (~itchyjunk@user/itchyjunk/x-7353470) (Read error: Connection reset by peer)
23:29:04 <sm> do you think that includes any problematic exploit-friendly chars ?
23:30:20 <monochrom> > let x = 'ᴀ' in (ord x, isAlphaNum x)
23:30:21 <lambdabot> (7424,True)
23:30:27 <ski> > [c | c <- [minBound .. maxBound],isAlphaNum c]
23:30:28 <lambdabot> "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz\170\178\179\...
23:31:58 <sm> the kind that don't render, or change the direction of rendering, or look like things they're not...
23:32:10 sm prints that list.. ooh yeah that's fun
23:32:26 AlexNoo_ joins (~AlexNoo@94.233.241.230)
23:33:11 <monochrom> > let x = 'ⅰ' in (ord x, isNumber x)
23:33:12 <lambdabot> (8560,True)
23:33:29 <sm> yeah.. there's no way to audit that. On the upside, includes elvish runes, which would be awesome to use
23:33:29 <monochrom> (That's Roman numeral ⅰ)
23:33:57 × Tuplanolla quits (~Tuplanoll@91-159-68-166.elisa-laajakaista.fi) (Ping timeout: 240 seconds)
23:34:49 <monochrom> > isNumber '①'
23:34:50 <lambdabot> True
23:34:57 monochrom is number ① :)
23:35:03 × Null_A quits (~null_a@2601:645:8700:2290:dcf9:b60:3266:d217) (Remote host closed the connection)
23:35:21 <monochrom> err there is a better one
23:35:25 <monochrom> > isNumber '⒈'
23:35:26 <lambdabot> True
23:35:37 × Alex_test quits (~al_test@94.233.241.94) (Ping timeout: 256 seconds)
23:35:37 × AlexZenon quits (~alzenon@94.233.241.94) (Ping timeout: 256 seconds)
23:35:42 monochrom is number ⒈ (number one, period) :)
23:35:56 <awpr> > isNumber '∞'
23:35:57 <lambdabot> False
23:36:11 × AlexNoo quits (~AlexNoo@94.233.241.94) (Ping timeout: 256 seconds)
23:36:54 sm uploaded an image: (861KiB) < https://libera.ems.host/_matrix/media/r0/download/matrix.org/sIiMOUQfMefwmCrUWKIdYdcN/Screen%20Shot%202022-02-06%20at%201.36.28%20PM.png >
23:37:15 <sm> ^ that's the first screenful. I'm puzzled by the lower 2/3, are those semigraphics ? Or a limitation of my font /
23:38:54 <monochrom> ⅔ is a thing
23:38:56 <geekosaur> looks to me like emacs might not handle the astral plane correctly?
23:39:10 <geekosaur> (that is, non-BMP)
23:39:17 × MochizukisLastTh quits (~Mochizuki@112-68-46-13f1.osk2.eonet.ne.jp) (Quit: Client closed)
23:39:18 <monochrom> > let x = '⅔' in (ord x, generalCategory x)
23:39:19 <lambdabot> (8532,OtherNumber)
23:39:26 Alex_test joins (~al_test@94.233.241.230)
23:39:27 AlexZenon joins (~alzenon@94.233.241.230)
23:39:50 <monochrom> Oh nevermind :)
23:40:04 <awpr> > read "⅔" :: Rational
23:40:05 <hpc> @let ⅔ = 2/3
23:40:05 <lambdabot> Parse failed: Illegal character ''\8532''
23:40:06 <lambdabot> *Exception: Prelude.read: no parse
23:40:07 <hpc> :(
23:40:20 <Axman6> :(
23:40:40 <Axman6> @let a⅔ = 2/3
23:40:41 <lambdabot> Defined.
23:41:05 <Axman6> pronounced "A two third"
23:41:47 <byorgey> monochrom: in my font
23:41:55 <sm> unicode is amazing
23:42:04 <awpr> 1/4 = "one fourth", so 3/2 = "one twothirdsth"?
23:42:04 <Cale> Also known as d
23:42:06 <byorgey> monochrom: in my font ⒈ looks like "bottom, period"
23:42:16 <sm> and has hung my emacs/vs code, as I half expected
23:42:58 <monochrom> bottom is OK. I'm the foundation of you all!
23:43:32 <sm> ok, got it back, but see how it has corrupted the minibuffer rendering:
23:43:37 sm uploaded an image: (23KiB) < https://libera.ems.host/_matrix/media/r0/download/matrix.org/QcdiRBcGMmbubAYdWbKHFJgB/image.png >
23:44:01 <sm> I guess I'm looking for a more restrictive isAlphaNum, to enable smaller subsets
23:44:12 eggplantade joins (~Eggplanta@2600:1700:bef1:5e10:1dc4:f5c4:a458:81)
23:45:57 × oscurochu quits (~oscurochu@097-096-050-227.res.spectrum.com) (Remote host closed the connection)
23:46:32 oscurochu joins (~oscurochu@097-096-050-227.res.spectrum.com)
23:47:25 <Cale> (perfect fourth down from a)
23:48:46 <maerwald> sm: chop it off
23:49:09 <monochrom> There is isAscii
23:49:30 <sm> they're complaining about isAscii
23:49:42 <sm> I can't understand it
23:49:58 <monochrom> Are they OK with isLatin1?
23:50:02 <Cale> awpr: haha, 3/2 = "one (perfect) fifth"
23:50:18 <awpr> 2 = 2/3 confirmed
23:50:23 <awpr> 5 = 2/3
23:50:35 <sm> monochrom: oh that sounds like a nice progressive step. (Would like CJK too maybe)
23:50:55 × oscurochu quits (~oscurochu@097-096-050-227.res.spectrum.com) (Ping timeout: 256 seconds)
23:52:45 × ProfSimm quits (~ProfSimm@87.227.196.109) (Remote host closed the connection)
23:54:49 × geekosaur quits (~geekosaur@xmonad/geekosaur) (Remote host closed the connection)
23:56:33 geekosaur joins (~geekosaur@xmonad/geekosaur)
23:59:21 × xcmw quits (~textual@071-087-004-073.biz.spectrum.com) (Quit: My MacBook has gone to sleep. ZZZzzz…)

All times are in UTC on 2022-02-06.