Home liberachat/#haskell: Logs Calendar

Logs on 2023-04-18 (liberachat/#haskell)

00:00:13 × zeenk quits (~zeenk@2a02:2f0e:7900:da01:b4a3:67c4:d0e3:beb0) (Excess Flood)
00:00:14 × falafel quits (~falafel@2603-8000-d700-115c-d504-7657-372e-1c6d.res6.spectrum.com) (Ping timeout: 265 seconds)
00:00:41 zeenk joins (~zeenk@2a02:2f0e:7900:da01:b4a3:67c4:d0e3:beb0)
00:02:41 <maralorn> Tried disabling the GC that helped a bit. Still a bit hit and miss though.
00:03:00 × zeenk quits (~zeenk@2a02:2f0e:7900:da01:b4a3:67c4:d0e3:beb0) (Excess Flood)
00:03:22 zeenk joins (~zeenk@2a02:2f0e:7900:da01:b4a3:67c4:d0e3:beb0)
00:04:46 × califax quits (~califax@user/califx) (Remote host closed the connection)
00:04:48 × Lord_of_Life quits (~Lord@user/lord-of-life/x-2819915) (Ping timeout: 248 seconds)
00:05:52 califax joins (~califax@user/califx)
00:06:04 Lord_of_Life joins (~Lord@user/lord-of-life/x-2819915)
00:09:56 × dcleonarski quits (~user@2804:d51:4793:c800:b0e2:a2e8:89a0:4c46) (Remote host closed the connection)
00:14:33 zeenk2 joins (~zeenk@188.26.30.104)
00:14:44 × zeenk quits (~zeenk@2a02:2f0e:7900:da01:b4a3:67c4:d0e3:beb0) (Ping timeout: 265 seconds)
00:19:11 opticblast joins (~Thunderbi@172.58.87.218)
00:20:24 × zeenk2 quits (~zeenk@188.26.30.104) (Quit: Konversation terminated!)
00:23:46 <maralorn> I get the feeling that HeapSize is underrepresenting the size of Text.
00:24:03 × waleee quits (~waleee@2001:9b0:21c:4000:5bf9:6515:c030:57b7) (Ping timeout: 260 seconds)
00:25:07 AlexNoo_ joins (~AlexNoo@178.34.150.15)
00:26:08 × AlexNoo quits (~AlexNoo@178.34.150.15) (Read error: Connection reset by peer)
00:26:36 × euandreh quits (~Thunderbi@189.6.18.7) (Remote host closed the connection)
00:27:27 euandreh joins (~Thunderbi@189.6.18.7)
00:28:14 chanceyan joins (~chanceyan@user/chanceyan)
00:28:48 × elain4 quits (~textual@2601:5c0:8200:990:2967:7d1e:b120:3523) (Quit: My MacBook has gone to sleep. ZZZzzz…)
00:30:13 × chanceyan quits (~chanceyan@user/chanceyan) (Client Quit)
00:33:38 merijn joins (~merijn@86-86-29-250.fixed.kpn.net)
00:37:45 × merijn quits (~merijn@86-86-29-250.fixed.kpn.net) (Ping timeout: 240 seconds)
00:40:25 × ft quits (~ft@i59F54987.versanet.de) (Ping timeout: 240 seconds)
00:42:23 ft joins (~ft@87.122.11.39)
00:48:09 machinedgod joins (~machinedg@d198-53-218-113.abhsia.telus.net)
00:50:55 × y04nn quits (~username@2a03:1b20:5:f011::aaae) (Ping timeout: 252 seconds)
00:58:48 motherfsck joins (~motherfsc@user/motherfsck)
00:59:24 koley joins (~koley@eth-east-parth2-46-193-66-191.wb.wifirst.net)
01:07:57 <koley> Hey, I don't know how to really ask my question, but I'm currently fighting a very weird issue: when building with `ghc` directly or running `stack ghci`, everything works fine, but trying to compile it with `stack build` (or `cabal build` for that matter) fails because of GHC complains cause it can't deduce constraints that seem obvious from the context
01:08:49 <sclv> ghc never deduces constraints
01:09:01 <koley> wdym
01:09:01 <sclv> you always need to give them explicitly
01:09:08 <koley> right ok that wasn't clear
01:09:09 <koley> hold on
01:09:15 <koley> For example, let's say I have a class `Foo a` with a function `someVal :: a`
01:09:21 <sclv> when using ghc directly you just happen to get things in scope automatically
01:10:02 <sclv> ok, go on
01:10:05 Me-me joins (~Me-me@146.102.215.218.dyn.iprimus.net.au)
01:10:07 <koley> in a function with constraints `(Show a, Foo a) => ...`, if i write `show (someVal :: a)`, it will complain that it couldn't deduce `Foo a1` (and `Show a1` as well)
01:10:22 <sclv> oh right, this is defaulting!
01:10:38 <sclv> ghci has “extended default rules” on to make the repl easier
01:10:39 × albet70 quits (~xxx@2400:8902::f03c:92ff:fe60:98d8) (Read error: Connection reset by peer)
01:10:56 <monochrom> ghci has extra "helpful" defaulting to pick a preferred instance so as to be able to proceed.
01:11:24 <koley> Ok, but why does it work if I just do `ghc ../app/Main.hs` (with no other options) but not through stack/cabal ?
01:11:32 <sclv> you could add the flag to your ghc invocation but i recommend using more explicit signatures. the extended rules are dodgy and only useful for rapid development
01:11:47 <monochrom> So that a "simple" "print []" does not error out with the "stupid" error of "I don't know how to print [] unless you tell me the element type".
01:11:49 zer0bitz_ joins (~zer0bitz@2001:2003:f443:d600:a0d9:2bf4:3f2:ae1)
01:11:56 <koley> What should I add here then?
01:12:13 <koley> I though `show (someVal :: a)` was explicit enough
01:12:33 <monochrom> But no, this is not stupid or simple, it matters. If the element type is Char, [] is printed as ""; otherwise, [] is printed as []. It matters. ghci is wrong.
01:12:55 × zer0bitz quits (~zer0bitz@2001:2003:f443:d600:3487:52ee:852d:d7d6) (Ping timeout: 252 seconds)
01:13:38 <monochrom> someVal :: Int
01:13:49 <monochrom> or whatever is appropriate instead of Int.
01:13:54 <sclv> also you may need quantification flags on
01:13:54 <monochrom> Pick a concrete type.
01:14:33 <koley> Well, except I can't do that; it's in an instance like `(Show a, Foo a) => Show (Bar a)`
01:14:34 <monochrom> Likewise you are supposed to have no luck with "show minBound".
01:14:45 <sclv> this isn’t defaulting then
01:14:53 <koley> ah
01:14:56 <sclv> it’s different sets if extensions enables
01:15:26 <koley> What?
01:15:29 <sclv> ghc has a big set enabled, but often the cabal file specifies another one. let me double check details
01:16:11 <monochrom> Oh, do you mean Haskell2010 vs GHC2021?
01:16:30 <koley> the cabal file has Haskell2010
01:16:38 <sclv> https://ghc.gitlab.haskell.org/ghc/doc/users_guide/exts/control.html
01:16:44 <sclv> yah.
01:16:46 albet70 joins (~xxx@2400:8902::f03c:92ff:fe60:98d8)
01:17:24 <koley> ok so changing it to ghc2021 fixed it!
01:17:36 <sclv> having the a on the outside and the inside be the same requires scoped type variables, an extension in the ghc set but not the h2020 set
01:17:43 <sclv> yay
01:18:05 <koley> Thanks!
01:19:56 <koley> ScopedTypeVariables works as well, wouldn't have guessed that it had something to do with it
01:20:02 <koley> tbf i'm very much still a noob lol
01:20:07 <koley> anyway thanks both of you :)
01:21:34 <Axman6> yeah that's the classic scoped type variables problem - did it get enabled by default in GHC2021?
01:21:37 × noxp quits (~psy@104-62-224-96.lightspeed.chrlnc.sbcglobal.net) (Quit: Leaving)
01:23:21 <yushyin> yes
01:26:13 × xff0x quits (~xff0x@2405:6580:b080:900:1f6d:bb02:ed12:309d) (Ping timeout: 250 seconds)
01:27:23 koley parts (~koley@eth-east-parth2-46-193-66-191.wb.wifirst.net) ()
01:29:58 × Igloo quits (~ian@matrix.chaos.earth.li) (Ping timeout: 252 seconds)
01:37:29 wroathe joins (~wroathe@207-153-38-140.fttp.usinternet.com)
01:37:29 × wroathe quits (~wroathe@207-153-38-140.fttp.usinternet.com) (Changing host)
01:37:29 wroathe joins (~wroathe@user/wroathe)
01:40:06 Igloo joins (~ian@matrix.chaos.earth.li)
01:46:37 × opticblast quits (~Thunderbi@172.58.87.218) (Ping timeout: 276 seconds)
01:52:28 × JScript quits (~JScript@45.248.77.204) (Ping timeout: 276 seconds)
01:54:44 falafel joins (~falafel@2603-8000-d700-115c-995e-95f4-3442-4b6d.res6.spectrum.com)
01:54:58 × ubert quits (~Thunderbi@p548c84d6.dip0.t-ipconnect.de) (Remote host closed the connection)
01:55:17 ubert joins (~Thunderbi@p548c84d6.dip0.t-ipconnect.de)
01:59:11 × falafel quits (~falafel@2603-8000-d700-115c-995e-95f4-3442-4b6d.res6.spectrum.com) (Ping timeout: 246 seconds)
02:04:17 oac joins (~oac@50-93-248-155.fttp.usinternet.com)
02:05:25 × machinedgod quits (~machinedg@d198-53-218-113.abhsia.telus.net) (Ping timeout: 240 seconds)
02:06:05 × Techcable quits (~Techcable@user/Techcable) (Ping timeout: 250 seconds)
02:08:25 × td_ quits (~td@i53870920.versanet.de) (Ping timeout: 240 seconds)
02:10:08 lisbeths joins (uid135845@id-135845.lymington.irccloud.com)
02:10:31 td_ joins (~td@i53870902.versanet.de)
02:11:05 xff0x joins (~xff0x@125x103x176x34.ap125.ftth.ucom.ne.jp)
02:13:58 × gentauro quits (~gentauro@user/gentauro) (Ping timeout: 252 seconds)
02:15:25 nate1 joins (~nate@98.45.169.16)
02:20:55 gentauro joins (~gentauro@user/gentauro)
02:22:33 × [itchyjunk] quits (~itchyjunk@user/itchyjunk/x-7353470) (Ping timeout: 250 seconds)
02:26:45 [itchyjunk] joins (~itchyjunk@user/itchyjunk/x-7353470)
02:36:08 × [itchyjunk] quits (~itchyjunk@user/itchyjunk/x-7353470) (Read error: Connection reset by peer)
02:36:45 × thegeekinside quits (~thegeekin@189.180.119.50) (Ping timeout: 240 seconds)
02:37:45 × wroathe quits (~wroathe@user/wroathe) (Ping timeout: 240 seconds)
02:41:15 × terrorjack quits (~terrorjac@2a01:4f8:c17:87f8::) (Quit: The Lounge - https://thelounge.chat)
02:42:30 × krei-se quits (~krei-se@p50874388.dip0.t-ipconnect.de) (Ping timeout: 255 seconds)
02:43:00 terrorjack joins (~terrorjac@2a01:4f8:c17:87f8::)
02:45:32 krei-se joins (~krei-se@p57af2733.dip0.t-ipconnect.de)
02:51:40 JScript joins (~JScript@103.137.12.221)
02:51:42 × JScript quits (~JScript@103.137.12.221) (Max SendQ exceeded)
02:52:10 JScript joins (~JScript@103.137.12.221)
02:55:32 merijn joins (~merijn@86-86-29-250.fixed.kpn.net)
02:57:03 Techcable joins (~Techcable@user/Techcable)
02:58:00 eggplantade joins (~Eggplanta@2600:1700:38c5:d800:5432:460c:c9d6:3538)
02:59:30 finn_elija joins (~finn_elij@user/finn-elija/x-0085643)
02:59:30 × FinnElija quits (~finn_elij@user/finn-elija/x-0085643) (Killed (NickServ (Forcing logout FinnElija -> finn_elija)))
02:59:30 finn_elija is now known as FinnElija
03:00:03 × merijn quits (~merijn@86-86-29-250.fixed.kpn.net) (Ping timeout: 255 seconds)
03:04:57 × jero98772 quits (~jero98772@2800:484:1d84:9000::4) (Remote host closed the connection)
03:18:25 × nate1 quits (~nate@98.45.169.16) (Ping timeout: 240 seconds)
03:20:45 × shriekingnoise quits (~shrieking@186.137.175.87) (Ping timeout: 240 seconds)
03:27:03 × jle` quits (~jle`@cpe-23-240-75-236.socal.res.rr.com) (Ping timeout: 255 seconds)
03:29:07 jle` joins (~jle`@cpe-23-240-75-236.socal.res.rr.com)
03:30:24 <Inst> okay, i'm stuck
03:30:36 <Inst> is there a way to unzip a file from within Haskell?
03:30:52 <Inst> what i'm trying to do right now is with monomer, since monomer doesn't prepackage its own assets within the library
03:31:05 danrh joins (~danrh@2607:fea8:86a2:e930:d120:6ae1:d426:8aaf)
03:31:21 <Inst> to run an IO action within the file that checks if the assets exist, and if they don't, download them from a websource
03:31:27 <Inst> but the google web source is storing it as a zip
03:32:39 <Inst> also, what
03:32:40 <Inst> https://twitter.com/zhuowei/status/1610071092416110596
03:32:52 × oac quits (~oac@50-93-248-155.fttp.usinternet.com) (Quit: oac)
03:39:38 shriekingnoise joins (~shrieking@186.137.175.87)
03:41:59 × danrh quits (~danrh@2607:fea8:86a2:e930:d120:6ae1:d426:8aaf) (Read error: Connection reset by peer)
03:42:56 sammelweis joins (~quassel@2601:401:8200:2d4c:bd9:d04c:7f69:eb10)
04:06:36 _ht joins (~Thunderbi@28-52-174-82.ftth.glasoperator.nl)
04:14:13 trev joins (~trev@user/trev)
04:18:36 jinsun joins (~jinsun@user/jinsun)
04:21:41 × eggplantade quits (~Eggplanta@2600:1700:38c5:d800:5432:460c:c9d6:3538) (Remote host closed the connection)
04:23:03 eggplantade joins (~Eggplanta@2600:1700:38c5:d800:3df9:f2b9:6cdb:aef1)
04:24:21 mbuf joins (~Shakthi@49.207.178.186)
04:25:18 × lisbeths quits (uid135845@id-135845.lymington.irccloud.com) (Quit: Connection closed for inactivity)
04:27:41 drdo2 joins (~drdo@bl14-14-164.dsl.telepac.pt)
04:29:31 × drdo quits (~drdo@bl7-76-103.dsl.telepac.pt) (Ping timeout: 240 seconds)
04:29:31 drdo2 is now known as drdo
04:29:58 <Inst> welp, finally got it working, but via a very hacky asset checker
04:30:18 <Inst> now to figure out how to hook GHCup up to Monomer
04:30:41 <Inst> maerwald, just in case you're interested
04:49:31 × pyook quits (~puke@user/puke) (Remote host closed the connection)
04:49:44 pyook joins (~puke@user/puke)
04:55:54 nain joins (~nain@169.150.196.132)
05:00:01 <sm> go Inst
05:01:31 × pavonia quits (~user@user/siracusa) (Read error: Connection reset by peer)
05:01:51 pavonia joins (~user@user/siracusa)
05:03:33 × trev quits (~trev@user/trev) (Quit: trev)
05:05:38 trev joins (~trev@user/trev)
05:06:15 <Inst> thanks
05:10:23 mmhat joins (~mmh@p200300f1c7106e9dee086bfffe095315.dip0.t-ipconnect.de)
05:11:09 bgs joins (~bgs@212.85.160.171)
05:11:35 × mmhat quits (~mmh@p200300f1c7106e9dee086bfffe095315.dip0.t-ipconnect.de) (Client Quit)
05:17:26 takuan joins (~takuan@178-116-218-225.access.telenet.be)
05:19:15 gnalzo joins (~gnalzo@2a01:e0a:498:fd50:fcc6:bb5d:489a:ce8c)
05:29:45 × JScript quits (~JScript@103.137.12.221) (Ping timeout: 240 seconds)
05:32:40 × nek0 quits (~nek0@2a01:4f8:222:2b41::12) (Quit: The Lounge - https://thelounge.chat)
05:35:16 lisbeths joins (uid135845@id-135845.lymington.irccloud.com)
05:46:02 barak joins (~barak@bzq-84-110-161-42.cablep.bezeqint.net)
05:47:21 × trev quits (~trev@user/trev) (Quit: trev)
05:48:29 tr_ev joins (~trev@user/trev)
05:48:35 tr_ev is now known as trev
05:51:46 nek0 joins (~nek0@2a01:4f8:222:2b41::12)
05:53:05 × Vq quits (~vq@90-230-208-28-no77.tbcn.telia.com) (Ping timeout: 240 seconds)
05:53:46 × barak quits (~barak@bzq-84-110-161-42.cablep.bezeqint.net) (Read error: Connection reset by peer)
05:55:12 Vq joins (~vq@90-230-208-28-no77.tbcn.telia.com)
05:56:14 JScript joins (~JScript@103.137.12.220)
06:02:05 × Vq quits (~vq@90-230-208-28-no77.tbcn.telia.com) (Ping timeout: 240 seconds)
06:04:10 Vq joins (~vq@90-230-208-28-no77.tbcn.telia.com)
06:09:24 × tcard quits (~tcard@2400:4051:5801:7500:cf17:befc:ff82:5303) (Quit: Leaving)
06:09:27 × _ht quits (~Thunderbi@28-52-174-82.ftth.glasoperator.nl) (Quit: _ht)
06:10:44 gensyst joins (~gensyst@user/gensyst)
06:10:56 <gensyst> Hi, is this dangerous? https://dpaste.com/726FFYSE6
06:10:56 tcard joins (~tcard@2400:4051:5801:7500:cf17:befc:ff82:5303)
06:11:16 <gensyst> I wonder if I really have to do a pattern match on foo to extract the pointer later on, to make sure the ptr is alive when I work on it.
06:11:35 <gensyst> (fyi i have some reasons to do that finalizer shenanigans, instead of using foreignptr)
06:15:25 × nain quits (~nain@169.150.196.132) (Ping timeout: 252 seconds)
06:17:14 × kee quits (~~kee@user/wizzwizz4) (Ping timeout: 265 seconds)
06:25:57 kee joins (~~kee@user/wizzwizz4)
06:28:34 michalz joins (~michalz@185.246.207.203)
06:33:03 kenran joins (~user@user/kenran)
06:33:25 × Vq quits (~vq@90-230-208-28-no77.tbcn.telia.com) (Ping timeout: 240 seconds)
06:33:36 × JScript quits (~JScript@103.137.12.220) (Ping timeout: 248 seconds)
06:33:57 <[exa]> gensyst: why can't you do just with newForeignPtr and share the other Foo data with the finalizer function?
06:34:33 CiaoSen joins (~Jura@ip-109-43-178-39.web.vodafone.de)
06:35:09 × ryantrinkle quits (~ryantrink@140.174.248.64) (Ping timeout: 255 seconds)
06:35:31 Vq joins (~vq@90-230-208-28-no77.tbcn.telia.com)
06:35:34 <[exa]> anyway yeah I think there's nothing to prevent your finalizer being run when you still hold the Ptr
06:38:24 Square joins (~Square4@user/square)
06:38:49 mncheck joins (~mncheck@193.224.205.254)
06:39:13 × Square quits (~Square4@user/square) (Client Quit)
06:39:44 Square joins (~Square4@user/square)
06:47:14 lortabac joins (~lortabac@2a01:e0a:541:b8f0:7947:e8a0:99b6:e45a)
06:51:23 kuribas joins (~user@2a02:1808:5:e31e:4cb2:f1e7:308c:b866)
06:52:17 coot joins (~coot@213.134.170.228)
06:55:27 × ft quits (~ft@87.122.11.39) (Quit: leaving)
07:03:07 × kuribas quits (~user@2a02:1808:5:e31e:4cb2:f1e7:308c:b866) (Ping timeout: 248 seconds)
07:03:56 kuribas joins (~user@2a02:1808:5:e31e:7ed0:d5b7:3a88:e8cd)
07:04:01 × eggplantade quits (~Eggplanta@2600:1700:38c5:d800:3df9:f2b9:6cdb:aef1) (Ping timeout: 240 seconds)
07:04:05 × jwiegley quits (~jwiegley@76-234-69-149.lightspeed.frokca.sbcglobal.net) (Ping timeout: 240 seconds)
07:04:35 × Batzy quits (~quassel@user/batzy) (Ping timeout: 260 seconds)
07:04:56 × cyphase quits (~cyphase@user/cyphase) (Ping timeout: 260 seconds)
07:06:10 eggplantade joins (~Eggplanta@2600:1700:38c5:d800:aa:e7be:a5cb:6ac0)
07:07:51 jwiegley joins (~jwiegley@76-234-69-149.lightspeed.frokca.sbcglobal.net)
07:08:31 Batzy joins (~quassel@user/batzy)
07:10:14 × califax quits (~califax@user/califx) (Ping timeout: 255 seconds)
07:10:20 califax_ joins (~califax@user/califx)
07:10:53 cyphase joins (~cyphase@user/cyphase)
07:11:37 califax_ is now known as califax
07:11:38 alexherbo2 joins (~alexherbo@2a02-842a-8180-4601-a8d7-8dc6-1c8c-d61e.rev.sfr.net)
07:12:30 × jargon quits (~jargon@174-22-213-236.phnx.qwest.net) (Ping timeout: 255 seconds)
07:12:57 × kuribas quits (~user@2a02:1808:5:e31e:7ed0:d5b7:3a88:e8cd) (Remote host closed the connection)
07:13:09 kuribas joins (~user@2a02:1808:5:e31e:7ed0:d5b7:3a88:e8cd)
07:13:22 acidjnk joins (~acidjnk@p200300d6e715c449e993588d69a2b1db.dip0.t-ipconnect.de)
07:13:51 Wstfgl0_ joins (~Me-me@146.102.215.218.dyn.iprimus.net.au)
07:14:37 × Me-me quits (~Me-me@146.102.215.218.dyn.iprimus.net.au) (Ping timeout: 250 seconds)
07:14:46 Wstfgl0_ is now known as Me-me
07:16:19 nate1 joins (~nate@98.45.169.16)
07:16:44 × gnalzo quits (~gnalzo@2a01:e0a:498:fd50:fcc6:bb5d:489a:ce8c) (Quit: WeeChat 3.8)
07:18:08 falafel joins (~falafel@2603-8000-d700-115c-4927-b1d5-99ef-f5e0.res6.spectrum.com)
07:20:29 × alexherbo2 quits (~alexherbo@2a02-842a-8180-4601-a8d7-8dc6-1c8c-d61e.rev.sfr.net) (Remote host closed the connection)
07:21:22 × nate1 quits (~nate@98.45.169.16) (Ping timeout: 276 seconds)
07:23:28 × kuribas quits (~user@2a02:1808:5:e31e:7ed0:d5b7:3a88:e8cd) (Remote host closed the connection)
07:23:37 × tzh quits (~tzh@c-24-21-73-154.hsd1.or.comcast.net) (Quit: zzz)
07:23:55 <dminuoso> gensyst: I would say its dangerous, yes. Consider that doPointerStuff can simply be inlined.
07:24:14 <dminuoso> And depending on the surrounding code, that can cause the GC to trigger much easlier.
07:24:45 <dminuoso> And if you do a non-inline, its still dangerous because if a GC occurs right in the middle of doPointerStuff but before ptr is used, that finalizer gets called too.
07:25:42 <dminuoso> You really want to use a ForeignPtr + withForeignPtr.
07:25:54 <dminuoso> GHC has special support for exactly what you're attempting to do.
07:26:02 <dminuoso> https://hackage.haskell.org/package/base-4.18.0.0/docs/Foreign-ForeignPtr.html#v:withForeignPtr
07:26:57 <dminuoso> Take note that this makes use of special primops that you cannot simply mimic.
07:27:18 × Unicorn_Princess quits (~Unicorn_P@user/Unicorn-Princess/x-3540542) (Remote host closed the connection)
07:27:32 <dminuoso> Well I suppose you can use keepAlive# manually if for some reason you're forced to use that custom-but-not-real-ForeignPtr
07:27:33 × pyook quits (~puke@user/puke) (Remote host closed the connection)
07:27:53 pyook joins (~puke@user/puke)
07:28:55 mc47 joins (~mc47@xmonad/TheMC47)
07:30:01 × jwiegley quits (~jwiegley@76-234-69-149.lightspeed.frokca.sbcglobal.net) (Ping timeout: 240 seconds)
07:32:00 × johnw quits (~johnw@76-234-69-149.lightspeed.frokca.sbcglobal.net) (Ping timeout: 252 seconds)
07:32:43 merijn joins (~merijn@c-001-001-006.client.esciencecenter.eduvpn.nl)
07:32:55 <dminuoso> gensyst: https://gist.github.com/dminuoso/b8c602ed0c0e7b2f57ff3f0b39e70285
07:32:57 <dminuoso> If you must
07:38:17 nain joins (~nain@169.150.196.132)
07:43:38 jwiegley joins (~jwiegley@76-234-69-149.lightspeed.frokca.sbcglobal.net)
07:45:08 johnw joins (~johnw@76-234-69-149.lightspeed.frokca.sbcglobal.net)
07:49:04 <jackdk> gensyst: this is your libzip thing, right? where `zip_fclose` can return an `int` and you want to ensure that's available to Haskell whenever it happens to be finalised?
07:55:46 machinedgod joins (~machinedg@d198-53-218-113.abhsia.telus.net)
07:56:37 × mbuf quits (~Shakthi@49.207.178.186) (Quit: Leaving)
07:58:40 <Inst> if I give a rough outline of this project, could you tell me if I'm doing something wrong?
07:59:06 <Inst> monomer for GUI output, use System.Process to call GHCup (at this stage), collect data from System.Process, feed it back to monomer, ??? profit?
07:59:15 <Inst> it seems really dumb and trivial
07:59:26 <Inst> like, maybe System.Process isn't the right way to do this?
07:59:45 × shriekingnoise quits (~shrieking@186.137.175.87) (Ping timeout: 240 seconds)
08:01:40 vglfr joins (~vglfr@46.96.155.105)
08:03:40 × mc47 quits (~mc47@xmonad/TheMC47) (Remote host closed the connection)
08:04:05 × falafel quits (~falafel@2603-8000-d700-115c-4927-b1d5-99ef-f5e0.res6.spectrum.com) (Ping timeout: 260 seconds)
08:04:06 × witcher quits (~witcher@wiredspace.de) (Remote host closed the connection)
08:04:21 witcher joins (~witcher@wiredspace.de)
08:04:44 × phma quits (~phma@host-67-44-208-106.hnremote.net) (Read error: Connection reset by peer)
08:05:39 phma joins (phma@2001:5b0:215d:98b8:e349:d2b0:ba66:968)
08:06:34 <tomsmeding> Inst: don't see a problem
08:07:29 <tomsmeding> calling ghcup as a separate process is going to be less performant than calling ghcup as a library, but ~all that ghcup does is IO-bound anyway, so it's not like that's going to really matter
08:07:56 <tomsmeding> is monomer easy to compile and make work cross-platform these days?
08:12:15 <gensyst> [exa], probably foreignptr will work in this case, thanks
08:12:28 <gensyst> dminuoso, thanks for the insights. good to keep at the back of my mind on how GC works
08:13:06 <gensyst> jackdk, yeah it's related, although in this case it was about keeping the zip alive while the file is operated on (if the zip closes prematurely, the file operations will error).
08:13:24 <gensyst> jackdk, to deal with the file, your resourcet idea will work excellent
08:13:37 <gensyst> jackdk, (but for the zip, foreignptr will be fine because the zip close func returns void)
08:17:17 × Sgeo quits (~Sgeo@user/sgeo) (Read error: Connection reset by peer)
08:18:12 × nain quits (~nain@169.150.196.132) (Ping timeout: 255 seconds)
08:18:52 nain joins (~nain@169.150.196.132)
08:20:22 <Inst> tomsmeding: on Windows, you need a few workarounds for sdl2; i.e, the latest sdl2 will fail, and has to be configured via mingw first
08:21:30 <Inst> the biggest drawback of monomer as brainless haskell is that you'd need to configure cabal to install the assets that monomer relies on; it requires an icon to boot as well as typefaces to display any text
08:21:35 × eggplantade quits (~Eggplanta@2600:1700:38c5:d800:aa:e7be:a5cb:6ac0) (Remote host closed the connection)
08:21:44 <Inst> alternately, as I do, I have some code that detects whether the assets exists, and if not, downloads them from the web
08:22:01 <Inst> but the problem is, on Windows, the default icon is bmp, so you'd need to convert png to bmp
08:22:27 <Inst> otherwise: it is so delightfully brainless
08:22:48 <Inst> absolutely great, just the maintainer / developer needs help, and I'm not sure whether he wants to accept such
08:23:09 × drdo quits (~drdo@bl14-14-164.dsl.telepac.pt) (Ping timeout: 255 seconds)
08:23:27 drdo joins (~drdo@bl14-14-164.dsl.telepac.pt)
08:26:07 × sammelweis quits (~quassel@2601:401:8200:2d4c:bd9:d04c:7f69:eb10) (Ping timeout: 260 seconds)
08:31:12 cfricke joins (~cfricke@user/cfricke)
08:33:00 Feuermagier joins (~Feuermagi@user/feuermagier)
08:42:02 × chiselfuse quits (~chiselfus@user/chiselfuse) (Ping timeout: 255 seconds)
08:42:37 × Lord_of_Life quits (~Lord@user/lord-of-life/x-2819915) (Ping timeout: 276 seconds)
08:43:04 vpan joins (~0@mail.elitnet.lt)
08:44:04 chiselfuse joins (~chiselfus@user/chiselfuse)
08:45:18 × lisbeths quits (uid135845@id-135845.lymington.irccloud.com) (Quit: Connection closed for inactivity)
08:45:52 Lord_of_Life joins (~Lord@user/lord-of-life/x-2819915)
08:50:09 Lord_of_Life_ joins (~Lord@user/lord-of-life/x-2819915)
08:51:43 × Lord_of_Life quits (~Lord@user/lord-of-life/x-2819915) (Ping timeout: 276 seconds)
08:52:32 × euandreh quits (~Thunderbi@189.6.18.7) (Remote host closed the connection)
08:52:51 Lord_of_Life_ is now known as Lord_of_Life
08:53:25 NiceBird joins (~NiceBird@185.133.111.196)
08:58:42 × merijn quits (~merijn@c-001-001-006.client.esciencecenter.eduvpn.nl) (Ping timeout: 255 seconds)
09:01:23 mc47 joins (~mc47@xmonad/TheMC47)
09:02:09 × cyphase quits (~cyphase@user/cyphase) (Read error: Connection reset by peer)
09:04:16 cyphase joins (~cyphase@user/cyphase)
09:04:22 alexherbo2 joins (~alexherbo@2a02-842a-8180-4601-7843-6da6-1e4a-20b9.rev.sfr.net)
09:05:22 × cyphase quits (~cyphase@user/cyphase) (Client Quit)
09:11:58 × acidjnk quits (~acidjnk@p200300d6e715c449e993588d69a2b1db.dip0.t-ipconnect.de) (Ping timeout: 252 seconds)
09:13:42 cyphase joins (~cyphase@user/cyphase)
09:13:43 calamaxes[m] joins (~calamaxes@2001:470:69fc:105::3:47b2)
09:13:54 ph88 joins (~ph88@84-29-20-195.cable.dynamic.v4.ziggo.nl)
09:20:10 eggplantade joins (~Eggplanta@2600:1700:38c5:d800:6486:e69a:524e:7c3f)
09:21:49 __monty__ joins (~toonn@user/toonn)
09:22:01 chanceyan joins (~chanceyan@user/chanceyan)
09:23:28 <gensyst> Will a data structure ever be partially garbage collected, or is zero references for all records needed before it's garbage collected?
09:23:56 <gensyst> (basically, only some records have zero count, but the outer data structure has zero count)
09:24:04 <gensyst> hmm
09:24:20 × eggplantade quits (~Eggplanta@2600:1700:38c5:d800:6486:e69a:524e:7c3f) (Ping timeout: 246 seconds)
09:25:12 <tomsmeding> gensyst: if the fields are lifted, then those are separately gc'd, right?
09:25:21 <[exa]> gensyst: depends on boxing status of the fields btw. Also AFAIK there's no reference counting
09:26:14 × chanceyan quits (~chanceyan@user/chanceyan) (Client Quit)
09:26:16 JScript joins (~JScript@103.137.12.221)
09:26:19 × JScript quits (~JScript@103.137.12.221) (Max SendQ exceeded)
09:26:48 JScript joins (~JScript@103.137.12.221)
09:26:51 chanceyan joins (~chanceyan@user/chanceyan)
09:26:52 × JScript quits (~JScript@103.137.12.221) (Max SendQ exceeded)
09:26:56 merijn joins (~merijn@c-001-001-006.client.esciencecenter.eduvpn.nl)
09:27:30 JScript joins (~JScript@103.137.12.221)
09:27:34 × JScript quits (~JScript@103.137.12.221) (Max SendQ exceeded)
09:27:41 × chanceyan quits (~chanceyan@user/chanceyan) (Client Quit)
09:28:01 JScript joins (~JScript@103.137.12.221)
09:28:41 × econo quits (uid147250@user/econo) (Quit: Connection closed for inactivity)
09:30:08 ub joins (~Thunderbi@p548c84d6.dip0.t-ipconnect.de)
09:30:45 × ubert quits (~Thunderbi@p548c84d6.dip0.t-ipconnect.de) (Ping timeout: 240 seconds)
09:30:45 ub is now known as ubert
09:32:24 <hellwolf[m]> $ cabal run maths/lorenz.hs -- +RTS -N -s -ls | wc -l
09:32:39 <hellwolf[m]> It looks to me that cabal run cannot run it in multiple threads?
09:33:25 ubert1 joins (~Thunderbi@2a02:8109:abc0:6434:b660:4b0:ed52:1706)
09:33:54 <dcoutts_> hellwolf[m]: you're probably passing the RTS options to cabal, not passing them through to the program you're running
09:34:22 <dcoutts_> try cabal run blah.hs --RTS -- +RTS -N -s -ls
09:34:25 <hellwolf[m]> I used "--"
09:34:29 <dcoutts_> that's not relevant
09:34:45 <dcoutts_> ghc: Usage: <prog> <args> [+RTS <rtsopts> | -RTS <args>] ... --RTS <args>
09:34:45 <dcoutts_> ghc:
09:34:45 <dcoutts_> ghc: +RTS Indicates run time system options follow
09:34:45 <dcoutts_> ghc: -RTS Indicates program arguments follow
09:34:45 <dcoutts_> ghc: --RTS Indicates that ALL subsequent arguments will be given to the
09:34:46 <dcoutts_> ghc: program (including any of these RTS flags)
09:34:47 × merijn quits (~merijn@c-001-001-006.client.esciencecenter.eduvpn.nl) (Ping timeout: 256 seconds)
09:35:43 <dcoutts_> the program (cabal in this case) doesn't even see the RTS flags, whether or not they're before/after an argument "--"
09:35:59 <dcoutts_> You need --RTS as in the help text above
09:36:11 <hellwolf[m]> didnt' quite help
09:36:38 <hellwolf[m]> https://pastebin.com/UzTVi8dV
09:36:40 gurkenglas joins (~gurkengla@dynamic-046-114-183-107.46.114.pool.telefonica.de)
09:36:43 <hellwolf[m]> this is the program
09:36:55 <hellwolf[m]> I ran with
09:36:55 <hellwolf[m]> ```
09:36:55 <hellwolf[m]> cabal run maths/lorenz.hs -- --RTS +RTS -N -s -ls | wc -l
09:36:55 <hellwolf[m]> ```
09:37:05 <hellwolf[m]> using threadscope to examine it
09:37:14 <hellwolf[m]> but only one core is used
09:37:33 <hellwolf[m]> $ cat /proc/cpuinfo | grep process | wc -l
09:37:33 <hellwolf[m]> 12
09:38:31 <dcoutts_> You can see in threadscope what the process command line was, so you can check if the RTS flags are being passed through correctly
09:39:15 <dcoutts_> you can also just invoke the executable directly, rather than using cabal run
09:39:24 hellwolf[m] uploaded an image: (20KiB) < https://libera.ems.host/_matrix/media/v3/download/matrix.org/GOfWcUZsRHbUjJgpzXjnTGZg/image.png >
09:39:40 <hellwolf[m]> yea I was trying to be concise, since I didn't bother to create the boilerplate of a cabal project yet.
09:40:09 <hellwolf[m]> or it could be that I am using parallel wrong.
09:40:13 <hellwolf[m]> but I am out of idea now
09:40:15 <dcoutts_> ok good, so the arguments pass through is working
09:40:33 <dcoutts_> getting parallelism working effectively is always a bit tricky
09:40:39 <hellwolf[m]> it could be that I should just build the binary :) but I am holding out until I write that boilerplate
09:41:16 <hellwolf[m]> hellwolf 1026118 117 0.0 1075846068 5284 pts/8 Rl+ 12:40 0:03 /home/hellwolf/.cabal/script-builds/ac8d3cc4be766b05a3a70d903b54553ae32b9452686cda2325fe93f04510cf46/dist-newstyle/build/x86_64-linux/ghc-9.4.2/fake-package-0/x/cabal-script-lorenz.hs/build/cabal-script-lorenz.hs/cabal-script-lorenz.hs --RTS +RTS -N -s -ls
09:44:04 <hellwolf[m]> SPARKS: 101 (100 converted, 0 overflowed, 0 dud, 0 GC'd, 1 fizzled)
09:44:15 <hellwolf[m]> ^--
09:44:15 <hellwolf[m]> ```
09:44:15 <hellwolf[m]> $ cabal run maths/lorenz.hs -- +RTS -N -s -ls | wc -l
09:44:15 <hellwolf[m]> ```
09:44:21 <hellwolf[m]> output from
09:44:30 <hellwolf[m]> so the sparks were definitely created
09:44:36 <hellwolf[m]> just that there was no other cores being used
09:46:48 × gensyst quits (~gensyst@user/gensyst) (Quit: Leaving)
09:47:53 <hellwolf[m]> I suspect I am just using parallel wrong, but I can't understand why
09:53:12 hellwolf[m] uploaded an image: (13KiB) < https://libera.ems.host/_matrix/media/v3/download/matrix.org/yZGsHLKJixesvtlDzFyCwGzd/image.png >
09:53:48 × CiaoSen quits (~Jura@ip-109-43-178-39.web.vodafone.de) (Remote host closed the connection)
09:56:35 <probie> hellwolf[m]: do you get a different result if you force (i.e `rnf`) `rs` before the call to `mapM`?
09:57:28 <hellwolf[m]> ```
09:57:28 <hellwolf[m]> mapM (\(p,v) -> putStrLn (showFullFloat p . ("\t" ++) . showFullFloat v $ "")) (force rs)
09:57:28 <hellwolf[m]> ```
09:57:28 <hellwolf[m]> I just tried to use `force` from deepseq
09:57:29 <hellwolf[m]> same result
09:58:17 <hellwolf[m]> The fact that only one HEC is being used at any given time is very suspiious
09:58:24 <hellwolf[m]> ```
09:58:24 <hellwolf[m]> Productivity 100.0% of total user, 99.9% of total elapsed
09:58:24 <hellwolf[m]> ```
09:58:24 <hellwolf[m]> That core is fully utilized
09:59:44 <probie> What if you explicitly pass a number of capabilities (e.g. `+RTS -N4`)?
10:00:01 <hellwolf[m]> didn't help
10:00:49 merijn joins (~merijn@c-001-001-006.client.esciencecenter.eduvpn.nl)
10:00:58 acidjnk joins (~acidjnk@p200300d6e715c44958402cbcae5898a8.dip0.t-ipconnect.de)
10:01:55 hellwolf[m] uploaded an image: (13KiB) < https://libera.ems.host/_matrix/media/v3/download/matrix.org/IepDCFamdEbshrWVJXWZvznx/image.png >
10:01:58 <hellwolf[m]> now I get that!
10:01:58 <hellwolf[m]> :D
10:04:01 × jmdaemon quits (~jmdaemon@user/jmdaemon) (Ping timeout: 240 seconds)
10:07:30 <probie> That's interesting. When I tried the code you posted on pastebin (with `let rs = parMap (rpar `dot` rdeepseq)`), it used multiple physical cores without needing any change
10:07:52 <hellwolf[m]> you didn't do anything?
10:07:53 <hellwolf[m]> what's your ghc version
10:08:05 <probie> 9.2.4
10:08:23 × xff0x quits (~xff0x@125x103x176x34.ap125.ftth.ucom.ne.jp) (Ping timeout: 250 seconds)
10:09:26 <hellwolf[m]> let me use nix to try that verison
10:09:46 <hellwolf[m]> I had to use rdeepseq
10:09:57 <hellwolf[m]> which is quite clean still semantically
10:10:16 <hellwolf[m]> I'd avoid usint strictness notations, that feels ugly and black magic
10:10:35 <hellwolf[m]> mapM (\(p,v) -> putStrLn (showFullFloat p . ("\t" ++) . showFullFloat v $ ""))
10:10:35 <hellwolf[m]> (rs `using` parBuffer 100 rdeepseq) -- rs <-- without using parallel, slow slow slow
10:10:39 <hellwolf[m]> that's all I dd
10:11:36 <hellwolf[m]> it didn't help with 9.2.4
10:11:44 <hellwolf[m]> still needed the rdeepseq
10:11:49 <hellwolf[m]> but I am more or less happy now
10:12:28 <hellwolf[m]> still clean enough, all I needed is in the very end of the program to use parBuffer to inject parallel computation semantics
10:13:14 <probie> I get the same usage on 8.10.7 (although it's a lot slower). I also don't get any noticeable difference between `rseq` and `rdeepseq` (I do actually have one more change, I calculate a thousand points instead of a hundred so it takes longer)
10:14:05 <hellwolf[m]> hmm, weird indeed.
10:14:21 <hellwolf[m]> oh, but it could be the difference between our parallel package?
10:14:31 <hellwolf[m]> but I doubt, that package is quite stable
10:14:40 <hellwolf[m]> (I am using the latest cabal index)
10:16:31 × nain quits (~nain@169.150.196.132) (Remote host closed the connection)
10:20:20 <probie> I'm on 3.2.2.0 for parallel. I'm also on Linux.
10:23:25 <hellwolf[m]> yea, me too
10:23:25 <hellwolf[m]> I am out of idea :/
10:23:25 <hellwolf[m]> you also using cabal run?
10:24:23 <probie> I'm also using `cabal run`. I don't think there's anything wrong with your install. I think `rseq` should actually be insufficient, since that should just be evaluating the tuple to whnf (and not the doubles). Maybe `-O2` is doing something on my machine that it's not doing on yours?
10:26:05 <hellwolf[m]> how could that be :)
10:26:35 <hellwolf[m]> model name : Intel(R) Core(TM) i7-10750H CPU @ 2.60GHz
10:26:40 <hellwolf[m]> NixOS 22.05
10:26:44 <hellwolf[m]> what else can be different :)
10:28:45 <probie> Nevermind, I think it is just differences in the code, we're running. Since I still had `let rs = parMap (rpar `dot` rdeepseq) ...` instead of `let rs = map ...`, evaluating the tuple to whnf was actually causing full evaluation, which is why `rseq` was working for me
10:29:06 <probie> s/code, we/code we/
10:30:45 × merijn quits (~merijn@c-001-001-006.client.esciencecenter.eduvpn.nl) (Ping timeout: 240 seconds)
10:31:49 × vglfr quits (~vglfr@46.96.155.105) (Ping timeout: 276 seconds)
10:34:08 euandreh joins (~Thunderbi@189.6.18.7)
10:35:27 <maralorn> My programming has a Productivity 88.8% of total user, 92.8% of total elapsed. I have heard that’s "too low". Yet, my eventlog doesn’t really look like it’s keeping more data in memory than it should. So is this productivity something I should just accept or is it still probably indicative of a problem?
10:36:01 <maralorn> s/programming/program/
10:47:45 <[exa]> who measured your productivity?
10:47:48 <[exa]> I'd blame them.
10:59:11 xff0x joins (~xff0x@2405:6580:b080:900:47f6:92dd:c4d9:cca7)
11:01:40 zeenk joins (~zeenk@2a02:2f0e:7900:da01:b4a3:67c4:d0e3:beb0)
11:04:26 <Inst> hmmm, not sure, but this might be a problem with using System.Process
11:04:36 × zeenk quits (~zeenk@2a02:2f0e:7900:da01:b4a3:67c4:d0e3:beb0) (Remote host closed the connection)
11:04:40 <Inst> stdout via Windows might not be the same as on Posix systems
11:05:43 × FinnElija quits (~finn_elij@user/finn-elija/x-0085643) (Remote host closed the connection)
11:09:20 FinnElija joins (~finn_elij@user/finn-elija/x-0085643)
11:17:48 nate1 joins (~nate@98.45.169.16)
11:21:13 × jjhoo quits (~jahakala@user/jjhoo) (Ping timeout: 252 seconds)
11:21:15 × mikko quits (~mikko@user/mikko) (Ping timeout: 260 seconds)
11:22:52 vglfr joins (~vglfr@46.96.155.105)
11:23:10 × nate1 quits (~nate@98.45.169.16) (Ping timeout: 276 seconds)
11:23:23 jjhoo joins (~jahakala@user/jjhoo)
11:28:51 <hellwolf[m]> <maralorn> "My programming has a Productivit..." <- Have you fed that into threadscope to examine in details?
11:28:51 <hellwolf[m]> Sometimes it could be too-eager GC activity, and RTS option related to GC could be used to tune that.
11:31:34 merijn joins (~merijn@c-001-001-006.client.esciencecenter.eduvpn.nl)
11:36:11 mikko joins (~mikko@dsl-trebng22-58c1a8-185.dhcp.inet.fi)
11:36:12 × mikko quits (~mikko@dsl-trebng22-58c1a8-185.dhcp.inet.fi) (Changing host)
11:36:12 mikko joins (~mikko@user/mikko)
11:40:53 _ht joins (~Thunderbi@28-52-174-82.ftth.glasoperator.nl)
11:42:07 × anpad quits (~pandeyan@user/anpad) (Quit: ZNC 1.8.2 - https://znc.in)
11:43:15 ft joins (~ft@p4fc2a88b.dip0.t-ipconnect.de)
11:46:45 enoq joins (~enoq@2a05:1141:1f5:5600:b9c9:721a:599:bfe7)
11:49:50 <dminuoso> Is there a fancy way to test whether the most-significant bit is set?
11:51:09 <Rembane> dminuoso: Do you want more fancy than bit-anding with the greatest power of two of the number and then checking if the result is not equal to zero?
11:51:28 <dminuoso> Something as sleek as countLeadingZeros without having to update to GHC 9.6 :p
11:51:28 <Rembane> Where number is number data type.
11:51:32 <Rembane> Oh
11:52:02 <Rembane> Can you copy-paste the function into your codebase? :)
11:52:37 <ncf> why do you need GHC 9.6 for that? it was added in base 4.8
11:52:58 <dminuoso> ncf: Ohh! I totally read that as base 4.18
11:53:11 <dminuoso> I wish we didnt have that decoupled base versioning
11:53:15 <dminuoso> Its incredibly confusing
11:53:23 <dminuoso> Thanks that helps
11:53:32 <ncf> i'd just use finiteBitSize with testBit though
11:53:48 <dminuoso> Mmm. I guess that works too.
11:54:10 × pavonia quits (~user@user/siracusa) (Quit: Bye!)
11:55:26 <tomsmeding> testBit is probably faster, given that countLeadingZeros is more powerful (though perhaps the difference will be small in practice)
11:56:11 <dminuoso> tomsmeding: Oh I know. Im overoptimizing code I know to be in the coldest path of the stack mostly just because its fun.
11:56:23 <dminuoso> So that argument weighs heavily now.
11:56:33 <dminuoso> Damn.
11:57:39 <tomsmeding> :D
11:57:40 × bitdex quits (~bitdex@gateway/tor-sasl/bitdex) (Quit: = "")
11:58:17 <dminuoso> But seriously, I think sometimes its good practice to write space or time optimized code, even if its not necessary
11:58:23 <dminuoso> Especially if you dont get to do this otherwise
11:58:36 <dminuoso> If it occurs in library code, there's at least a good chance it might help somebody./
12:00:04 anpad joins (~pandeyan@user/anpad)
12:01:55 barcisz joins (~barcisz@79.191.65.29.ipv4.supernova.orange.pl)
12:04:59 × vglfr quits (~vglfr@46.96.155.105) (Ping timeout: 260 seconds)
12:05:55 × merijn quits (~merijn@c-001-001-006.client.esciencecenter.eduvpn.nl) (Ping timeout: 260 seconds)
12:11:58 ryantrinkle joins (~ryantrink@38.27.99.245)
12:12:27 × acidjnk quits (~acidjnk@p200300d6e715c44958402cbcae5898a8.dip0.t-ipconnect.de) (Ping timeout: 248 seconds)
12:19:03 × zer0bitz_ quits (~zer0bitz@2001:2003:f443:d600:a0d9:2bf4:3f2:ae1) ()
12:23:28 zer0bitz joins (~zer0bitz@2001:2003:f443:d600:a0d9:2bf4:3f2:ae1)
12:25:22 ChanServ sets mode +o litharge
12:25:23 litharge sets mode -bo lambdap237!*@*$##fix_your_connection litharge
12:29:07 <dminuoso> Unrelatedly, if you roundtrip a Word8 through Word16 via fromIntegral, is there an actual guarantee this will preserve the original number?
12:29:22 <dminuoso> The Haskell Report is very silent on this. The only extremely vague is this:
12:29:28 <dminuoso> For coercing between any two integer types, use fromIntegral. Coercing word types (see Data.Word) to
12:29:31 <dminuoso> and from integer types preserves representation, not sign.
12:30:04 <dminuoso> Very sadly, it doesnt really say anything else about what fromIntegral even does when the input number does not fit into the output type.
12:30:07 acidjnk joins (~acidjnk@p200300d6e715c449cd2640c690c889f7.dip0.t-ipconnect.de)
12:31:52 vglfr joins (~vglfr@88.155.49.118)
12:32:20 elain4 joins (~textual@2601:5c0:8200:990:98bc:8094:4755:4c83)
12:32:23 <[exa]> that's truly vaguest.
12:34:00 <dminuoso> The only other bit I can find is in the example code of the prelude mentioning `fromIntegral = fromInteger . toInteger`
12:34:24 <dminuoso> But the standard prescribes no behavior to fromInteger
12:35:31 qhong joins (~qhong@DN160vrd000d6kpg009l6c0000fj.stanford.edu)
12:35:32 <probie> dminuoso: which also means how literals are handled is underspecified :'). What is `256 :: Word8` according to the report?
12:35:34 <dminuoso> What's a little worrying is that 23.1 Unsigned integral types mentions
12:35:40 <dminuoso> `All arithmetic is performed modulo 2ˆn, where n is the number of bits in the type.`
12:36:42 <dminuoso> So with a slight bit of creativitiy, you could read into that that (fromIntegral x) doesnt truncate but gives you (x `mod` maxBound)
12:37:04 <dminuoso> which wouldnt quite work in general, as fromIntegral doesnt require Bounded.
12:37:26 <dminuoso> probie: Pretty sure that desugars into a use of fromIntegral
12:37:45 <dminuoso> but then again, no, I would have found that mention
12:38:06 <dminuoso> Ah no it is
12:38:12 <probie> No, it desugars into `fromInteger`
12:38:19 <dminuoso> Translation: The integer literal i is equivalent to fromInteger i , where fromInteger is a method in class Num (see Section 6.4.1).
12:38:41 kuribas joins (~user@ip-188-118-57-242.reverse.destiny.be)
12:38:51 <dminuoso> So judging from this, an implementation that just does (`mod` maxBound) seems compliant.
12:39:10 <dminuoso> though no, again that doesnt work without the Bounded constraint
12:39:49 <dminuoso> From an implementation point of view there's obviously only one thing to do (which is to truncate MSBs) - but its just a little disturbing that its not specified.
12:40:19 <__monty__> ¯\_(ツ)_/¯ (`mod` 2^∞) seems perfectly cromulent to me.
12:40:49 <probie> dminuoso: what predefined Integral types apart from Integer aren't instances of Bounded?
12:40:55 <dminuoso> __monty__: thing is, Amazon is out of ∞GiB memory modules.
12:41:02 <dminuoso> So I cant work with that (yet)
12:41:31 <dminuoso> probie: Integer
12:41:37 <__monty__> But that would imply you can only use Bounded types anyway, so it still reduces to not being a practical worry ; )
12:42:52 <probie> `mod` 2^∞ is just id
12:42:52 y04nn joins (~username@2a03:1b20:5:f011::aaae)
12:43:17 hayden_ joins (~hayden@158.123.160.43)
12:43:35 <dminuoso> probie: Im still running quickcheck tests on that to be sure.
12:43:39 <dminuoso> Will let you know when its done.
12:43:55 <dminuoso> Actually, we dont need a Bounded constraint on Integral
12:44:09 <dminuoso> Its sufficient for Num to carry the modulo behavior on fromInteger
12:44:16 <dminuoso> So I guess it *is* compliant./
12:44:40 <dminuoso> (`mod` maxBound) is conforming then.
12:45:18 × y04nn quits (~username@2a03:1b20:5:f011::aaae) (Read error: Connection reset by peer)
12:48:30 <mauke> did you mean `mod` (maxBound + 1)
12:49:04 <dminuoso> mauke: mmm, yeah I suppose.
12:50:31 <mauke> .oO( I know my standard C unsigned integer semantics )
13:03:02 barcisz90 joins (~barcisz@79.191.65.29.ipv4.supernova.orange.pl)
13:04:43 barcisz9048 joins (~barcisz@79.191.65.29.ipv4.supernova.orange.pl)
13:06:51 × elain4 quits (~textual@2601:5c0:8200:990:98bc:8094:4755:4c83) (Quit: My MacBook has gone to sleep. ZZZzzz…)
13:07:10 × barcisz quits (~barcisz@79.191.65.29.ipv4.supernova.orange.pl) (Ping timeout: 276 seconds)
13:08:28 × barcisz90 quits (~barcisz@79.191.65.29.ipv4.supernova.orange.pl) (Ping timeout: 276 seconds)
13:11:40 × hayden_ quits (~hayden@158.123.160.43) (Quit: Leaving)
13:11:48 hayden_ joins (~hayden@158.123.160.43)
13:16:25 × hayden_ quits (~hayden@158.123.160.43) (Remote host closed the connection)
13:16:32 × Me-me quits (~Me-me@146.102.215.218.dyn.iprimus.net.au) (Quit: Going offline, see ya! (www.adiirc.com))
13:16:42 hayden_ joins (~hayden@158.123.160.43)
13:23:19 merijn joins (~merijn@c-001-001-006.client.esciencecenter.eduvpn.nl)
13:23:27 eggplantade joins (~Eggplanta@2600:1700:38c5:d800:6486:e69a:524e:7c3f)
13:24:31 heraldo joins (~heraldo@user/heraldo)
13:27:02 × hayden_ quits (~hayden@158.123.160.43) (Quit: Leaving)
13:28:00 × eggplantade quits (~Eggplanta@2600:1700:38c5:d800:6486:e69a:524e:7c3f) (Ping timeout: 248 seconds)
13:30:03 × hgolden quits (~hgolden@cpe-172-251-233-141.socal.res.rr.com) (Remote host closed the connection)
13:33:01 hgolden joins (~hgolden@cpe-172-251-233-141.socal.res.rr.com)
13:33:52 × heraldo quits (~heraldo@user/heraldo) (Ping timeout: 248 seconds)
13:38:17 wroathe joins (~wroathe@207-153-38-140.fttp.usinternet.com)
13:38:17 × wroathe quits (~wroathe@207-153-38-140.fttp.usinternet.com) (Changing host)
13:38:17 wroathe joins (~wroathe@user/wroathe)
13:39:03 × pyook quits (~puke@user/puke) (Ping timeout: 255 seconds)
13:41:58 barcisz904811 joins (~barcisz@79.191.65.29.ipv4.supernova.orange.pl)
13:44:11 × wroathe quits (~wroathe@user/wroathe) (Ping timeout: 250 seconds)
13:45:31 × barcisz9048 quits (~barcisz@79.191.65.29.ipv4.supernova.orange.pl) (Ping timeout: 276 seconds)
13:48:39 × dsrt^ quits (~dsrt@c-76-105-96-13.hsd1.ga.comcast.net) (Remote host closed the connection)
13:54:56 barcisz904811100 joins (~barcisz@79.191.65.29.ipv4.supernova.orange.pl)
13:54:57 AlexNoo_ is now known as AlexNoo
13:56:24 barcisz joins (~barcisz@79.191.65.29.ipv4.supernova.orange.pl)
13:57:30 × merijn quits (~merijn@c-001-001-006.client.esciencecenter.eduvpn.nl) (Ping timeout: 255 seconds)
13:58:25 × barcisz904811 quits (~barcisz@79.191.65.29.ipv4.supernova.orange.pl) (Ping timeout: 240 seconds)
13:59:05 × barcisz904811100 quits (~barcisz@79.191.65.29.ipv4.supernova.orange.pl) (Ping timeout: 240 seconds)
14:06:48 <ski> > (10 :: Word8) `mod` (maxBound + 1)
14:06:49 <lambdabot> *Exception: divide by zero
14:08:25 <ski> (although, obviously we ought to have `mod n 0 = n' .. cf. `gcd 0 0 = 0')
14:11:10 elain4 joins (~textual@static-71-251-226-194.rcmdva.fios.verizon.net)
14:11:19 × hugo quits (znc@verdigris.lysator.liu.se) (Ping timeout: 256 seconds)
14:13:05 barcisz71 joins (~barcisz@79.191.65.29.ipv4.supernova.orange.pl)
14:14:03 × acidjnk quits (~acidjnk@p200300d6e715c449cd2640c690c889f7.dip0.t-ipconnect.de) (Ping timeout: 248 seconds)
14:16:07 × barcisz quits (~barcisz@79.191.65.29.ipv4.supernova.orange.pl) (Ping timeout: 252 seconds)
14:16:58 × szkl quits (uid110435@id-110435.uxbridge.irccloud.com) (Quit: Connection closed for inactivity)
14:17:40 × barcisz71 quits (~barcisz@79.191.65.29.ipv4.supernova.orange.pl) (Ping timeout: 265 seconds)
14:19:38 <dminuoso> ski: hah I see a recursive problem here.
14:20:00 <dminuoso> but we can fix that with sprinkling in some toInteger
14:20:04 thegeekinside joins (~thegeekin@189.180.119.50)
14:20:38 <dminuoso> Mmm, not entirely though
14:22:32 hugo joins (znc@verdigris.lysator.liu.se)
14:22:33 <ski> recursive problem ?
14:23:42 <dminuoso> Well I suppose we cant sensibly implement fromIntegral in terms of `mod`
14:24:39 <dminuoso> To get maxBound + 1 to work right, you would go through toInteger for the modular arithmatic to work right, we would need a separate fromIntegral (one that explicitly truncates)
14:24:50 <dminuoso> To get back to the original type
14:25:07 <ski> @type fromInteger
14:25:08 <lambdabot> Num a => Integer -> a
14:25:19 <dminuoso> Right, but as per haskell report its behavior is not defined
14:25:33 <dminuoso> (whether we talk about fromInteger or fromIntegral is pretty much irrelevant)
14:25:50 <dminuoso> its what sparked my comments
14:26:15 <ski> mhm
14:28:13 <dminuoso> But I guess if we look even closer, much of the numeric interface isnt prescribed any behavior.
14:28:36 <dminuoso> Say what (+) even means/does
14:28:55 <geekosaur> this is why nobody likes Num
14:29:12 × enoq quits (~enoq@2a05:1141:1f5:5600:b9c9:721a:599:bfe7) (Quit: enoq)
14:29:43 <probie> The interface can't be meaningfully prescribed behaviour, only specific instances of it
14:29:47 <dminuoso> Is there some general behavior/abstraction in mathematics that encompasses what we tend to mean by addition?
14:29:54 <dminuoso> probie: why *cant* it?
14:30:21 <probie> Because all `Num` promises is that `(+) :: a -> a -> a`. It can't promise semantics for new instances
14:30:30 <dminuoso> Surely with denotational semantics there should be some mathematical model to pin it to.
14:30:50 <dminuoso> probie: it can easily mandate laws.
14:31:04 <probie> It can suggest laws
14:31:05 <dminuoso> Like it does for Functor
14:31:55 <dminuoso> Well the haskell report phrases stronger than a suggestion.
14:32:01 <dminuoso> They state that instances "should satisfy..."
14:32:03 shriekingnoise joins (~shrieking@186.137.175.87)
14:32:17 <probie> should isn't must
14:32:25 <dminuoso> but its stronger than `may`
14:34:20 sammelweis joins (~quassel@2601:401:8200:2d4c:bd9:d04c:7f69:eb10)
14:35:51 <probie> without falling back to something like "the expected behaviour of addition", what would like the report to say?
14:36:16 <probie> s/would like/would you like/
14:37:28 <probie> remember, you can't even ask for something like associativity because we have floats and doubles
14:37:42 × kenran quits (~user@user/kenran) (Remote host closed the connection)
14:39:51 <dminuoso> Yes, that may be a good thing even.
14:40:06 <dminuoso> It might teach people that float/double really isnt the same as integers.
14:40:41 <dminuoso> To give you an interface that *looks* like it has all the same properties and laws of standard algebra with integers might have been one of the worst things that langauges have done with IEEE 754
14:41:04 acidjnk joins (~acidjnk@p200300d6e715c424008a03a563343fd8.dip0.t-ipconnect.de)
14:41:19 <geekosaur> isn't there some variant algebra which covers (even was built around) IEEE 754?
14:41:44 ski idly notes that `real' in SML was demoted from `eqtype' status, due to floating-point imprecision
14:42:42 hayden_ joins (~hayden@158.123.160.43)
14:43:25 × hayden_ quits (~hayden@158.123.160.43) (Remote host closed the connection)
14:51:05 merijn joins (~merijn@c-001-001-006.client.esciencecenter.eduvpn.nl)
14:54:20 × Inst quits (~Inst@2601:6c4:4081:54f0:71a6:8347:491d:ec1e) (Read error: Connection reset by peer)
14:55:55 × merijn quits (~merijn@c-001-001-006.client.esciencecenter.eduvpn.nl) (Ping timeout: 260 seconds)
15:09:31 Sgeo joins (~Sgeo@user/sgeo)
15:11:17 × sammelweis quits (~quassel@2601:401:8200:2d4c:bd9:d04c:7f69:eb10) (Ping timeout: 250 seconds)
15:13:31 × cfricke quits (~cfricke@user/cfricke) (Quit: WeeChat 3.8)
15:14:11 eggplantade joins (~Eggplanta@2600:1700:38c5:d800:6486:e69a:524e:7c3f)
15:15:54 × alexherbo2 quits (~alexherbo@2a02-842a-8180-4601-7843-6da6-1e4a-20b9.rev.sfr.net) (Remote host closed the connection)
15:16:14 alexherbo2 joins (~alexherbo@2a02-842a-8180-4601-7843-6da6-1e4a-20b9.rev.sfr.net)
15:19:19 nate1 joins (~nate@98.45.169.16)
15:23:45 × nate1 quits (~nate@98.45.169.16) (Ping timeout: 240 seconds)
15:33:05 × jle` quits (~jle`@cpe-23-240-75-236.socal.res.rr.com) (Ping timeout: 240 seconds)
15:35:17 jle` joins (~jle`@cpe-23-240-75-236.socal.res.rr.com)
15:36:51 <carbolymer> I'm troubleshooting haskdogs, and it seems that `ghc-pkg find-module Data.Aeson` this does not find aeson package. Should I do something to make cabal update ghc-pkg database?
15:37:42 ub joins (~Thunderbi@p200300ecdf114f0c8b5919de55b87561.dip0.t-ipconnect.de)
15:38:01 × ubert quits (~Thunderbi@p548c84d6.dip0.t-ipconnect.de) (Ping timeout: 256 seconds)
15:38:01 ubert1 is now known as ubert
15:38:01 ubert is now known as 082AASMYS
15:38:01 ub is now known as 074AAT82Q
15:38:18 barcisz joins (~barcisz@79.191.65.29.ipv4.supernova.orange.pl)
15:40:00 <geekosaur> --package-db ~/.cabal/store/ghc-<version>
15:40:46 × alexherbo2 quits (~alexherbo@2a02-842a-8180-4601-7843-6da6-1e4a-20b9.rev.sfr.net) (Remote host closed the connection)
15:40:48 <geekosaur> hm, actually that might need to point at the package db and not just the directoryy it's in
15:41:06 alexherbo2 joins (~alexherbo@2a02-842a-8180-4601-7843-6da6-1e4a-20b9.rev.sfr.net)
15:41:18 <geekosaur> --package-db ~/.cabal/store/ghc-<version>/package.db
15:43:41 econo joins (uid147250@user/econo)
15:43:58 <carbolymer> hmm, how can I get this path using cabal? i.e. I have different ghc versions for different projects
15:44:08 <carbolymer> or how can I get short ghc version from ghc itself?
15:44:46 <monochrom> ghc --numeric-version :)
15:47:02 <geekosaur> also this is the entire store, not limited to the versions associated with a given package
15:47:11 <geekosaur> I'm not sure how you get that
15:47:25 × mc47 quits (~mc47@xmonad/TheMC47) (Ping timeout: 252 seconds)
15:48:13 <carbolymer> monochrom: thx
15:48:24 <carbolymer> now it resolved aeson, but it can't resolve Prelude >.>
15:48:58 <geekosaur> looks like that is dist-newstyle/packagedb/ghc-<version>
15:49:20 <geekosaur> right, you'll need a separate package-db option to re-include the global package db
15:50:11 <monochrom> Are you trying to reinvent my https://github.com/treblacy/hasdoc ? >:)
15:50:59 <geekosaur> haskdogs is a tags file generator
15:51:20 <geekosaur> which doesn't know about cabal or stack so it fails on those
15:51:35 gnalzo joins (~gnalzo@2a01:e0a:498:fd50:fcc6:bb5d:489a:ce8c)
15:51:39 <carbolymer> geekosaur: actually it does, but I don't know why it started failing now
15:53:15 <carbolymer> https://github.com/grwlf/haskdogs/blob/master/src/Main.hs#L202
15:53:50 <geekosaur> oh, hm, while the cache references stuff in the store, it doesn't contain them. not sure how you get a package-db that references only the versions/builds in the store that a given cabal package actually uses
15:55:10 <geekosaur> (which I assume would be needed to actually build the package with all the right versions)
15:57:54 <sclv> this old-style interaction with the packagedb just won’t work anymore imho
15:57:58 <carbolymer> et voila!
15:57:58 <carbolymer> haskdogs --use-stack OFF --deps-dir "$XDG_DATA_HOME/haskdogs" --ghc-pkg-args "--package-db $CABAL_DIR/store/ghc-`ghc --numeric-version`/package.db --package-db `ghc --print-global-package-db`"
15:57:59 kspalaiologos joins (~kspalaiol@user/kspalaiologos)
15:58:19 <sclv> or i guess will, but is janky
15:58:27 <carbolymer> janky af
15:58:48 <carbolymer> but it's what we've got so ¯\_(ツ)_/¯
15:58:57 <sclv> if the goal is just to scan for lists of deps or something i’d think it can be done more directly
15:59:03 × lortabac quits (~lortabac@2a01:e0a:541:b8f0:7947:e8a0:99b6:e45a) (Quit: WeeChat 2.8)
15:59:37 <sclv> like with a plan.json or the like
16:00:04 × kspalaiologos quits (~kspalaiol@user/kspalaiologos) (Client Quit)
16:00:20 <monochrom> You can just say --package-db global
16:01:06 <monochrom> err, actually you can just say --global
16:01:50 <janus> wz1000: the download link in your discourse post is also broken. should use underscores, not dots. e.g. 9_4_5 not 9.4.5
16:03:35 <carbolymer> monochrom: ooh, that's nice, thanks!
16:04:54 × eggplantade quits (~Eggplanta@2600:1700:38c5:d800:6486:e69a:524e:7c3f) (Remote host closed the connection)
16:08:01 tzh joins (~tzh@c-24-21-73-154.hsd1.wa.comcast.net)
16:12:13 <janus> interesting that haskell.org just returns 500 if there are two dots in the extension
16:12:23 <janus> almost thought there was something wrong with server at first
16:14:44 <monochrom> I don't think that's true. https://downloads.haskell.org/~ghc/9.2.5/docs/users_guide.html.tar.xz has two dots in the extension and works.
16:14:46 × berberman quits (~berberman@user/berberman) (Quit: ZNC 1.8.2 - https://znc.in)
16:15:07 berberman joins (~berberman@user/berberman)
16:16:59 <janus> downloads is different, that's true. but e.g. https://www.haskell.org/ghc/download_ghc_9.4.5.html looks so innocent, yet explodes
16:17:32 <janus> the URLs look static, that makes it more surprising that it can make a 500
16:18:18 <monochrom> Oh! Internal error, not even 404, yeah that's a GHC panic. :)
16:21:05 × alexherbo2 quits (~alexherbo@2a02-842a-8180-4601-7843-6da6-1e4a-20b9.rev.sfr.net) (Remote host closed the connection)
16:21:25 alexherbo2 joins (~alexherbo@2a02-842a-8180-4601-7843-6da6-1e4a-20b9.rev.sfr.net)
16:24:00 × machinedgod quits (~machinedg@d198-53-218-113.abhsia.telus.net) (Ping timeout: 248 seconds)
16:25:22 × vpan quits (~0@mail.elitnet.lt) (Quit: Leaving.)
16:34:59 × kuribas quits (~user@ip-188-118-57-242.reverse.destiny.be) (Quit: ERC (IRC client for Emacs 27.1))
16:38:33 eggplantade joins (~Eggplanta@104-55-37-220.lightspeed.sntcca.sbcglobal.net)
16:45:46 × gnalzo quits (~gnalzo@2a01:e0a:498:fd50:fcc6:bb5d:489a:ce8c) (Quit: WeeChat 3.8)
16:50:14 × hgolden quits (~hgolden@cpe-172-251-233-141.socal.res.rr.com) (Remote host closed the connection)
16:51:35 merijn joins (~merijn@c-001-001-006.client.esciencecenter.eduvpn.nl)
16:53:31 × werneta quits (~werneta@70-142-214-115.lightspeed.irvnca.sbcglobal.net) (Remote host closed the connection)
16:55:53 × 082AASMYS quits (~Thunderbi@2a02:8109:abc0:6434:b660:4b0:ed52:1706) (Remote host closed the connection)
16:56:03 hgolden joins (~hgolden@cpe-172-251-233-141.socal.res.rr.com)
16:59:32 <wz1000> janus: fixed, thanks
17:03:48 × Square quits (~Square4@user/square) (Ping timeout: 255 seconds)
17:06:27 Nolrai joins (~Nolrai@c-98-232-218-193.hsd1.or.comcast.net)
17:11:35 jmdaemon joins (~jmdaemon@user/jmdaemon)
17:13:11 × trev quits (~trev@user/trev) (Quit: trev)
17:14:46 trev joins (~trev@user/trev)
17:19:14 oac joins (~oac@50-93-248-155.fttp.usinternet.com)
17:25:25 × merijn quits (~merijn@c-001-001-006.client.esciencecenter.eduvpn.nl) (Ping timeout: 240 seconds)
17:27:00 × terrorjack quits (~terrorjac@2a01:4f8:c17:87f8::) (Quit: The Lounge - https://thelounge.chat)
17:28:40 terrorjack joins (~terrorjac@2a01:4f8:c17:87f8::)
17:30:01 × gurkenglas quits (~gurkengla@dynamic-046-114-183-107.46.114.pool.telefonica.de) (Ping timeout: 240 seconds)
17:31:50 gurkenglas joins (~gurkengla@dynamic-046-114-178-126.46.114.pool.telefonica.de)
17:33:27 × barcisz quits (~barcisz@79.191.65.29.ipv4.supernova.orange.pl) (Quit: Connection closed)
17:33:48 barcisz joins (~barcisz@79.191.65.29.ipv4.supernova.orange.pl)
17:34:10 doyougnu joins (~doyougnu@cpe-74-69-132-225.stny.res.rr.com)
17:38:57 × barcisz quits (~barcisz@79.191.65.29.ipv4.supernova.orange.pl) (Quit: Connection closed)
17:44:08 <sm> not yet..
17:45:01 <sm> lots of nice fixes in 9.4.5 ❤️
17:45:48 <c_wraith> Is 9.6 going to have a similar release?
17:50:11 <geekosaur> I think this is mostly backports from 9.6?
17:52:33 ubert joins (~Thunderbi@p548c84d6.dip0.t-ipconnect.de)
17:52:48 <geekosaur> no milestone for 9.6.2, one open issue for 9.2.8, no milestone for 9.4.6
17:52:49 × 074AAT82Q quits (~Thunderbi@p200300ecdf114f0c8b5919de55b87561.dip0.t-ipconnect.de) (Remote host closed the connection)
17:53:28 <geekosaur> oh whoops, milestone list oisn't sorted
17:53:49 <geekosaur> 9.6.2 -> 29 issues open
18:09:13 × Nolrai quits (~Nolrai@c-98-232-218-193.hsd1.or.comcast.net) (Quit: Client closed)
18:10:39 × hgolden quits (~hgolden@cpe-172-251-233-141.socal.res.rr.com) (Remote host closed the connection)
18:11:04 hgolden joins (~hgolden@cpe-172-251-233-141.socal.res.rr.com)
18:13:25 barcisz joins (~barcisz@79.191.65.29.ipv4.supernova.orange.pl)
18:20:17 × alexherbo2 quits (~alexherbo@2a02-842a-8180-4601-7843-6da6-1e4a-20b9.rev.sfr.net) (Remote host closed the connection)
18:20:36 alexherbo2 joins (~alexherbo@2a02-842a-8180-4601-7843-6da6-1e4a-20b9.rev.sfr.net)
18:24:10 × msavoritias quits (cb716af6b3@irc.cheogram.com) (Ping timeout: 260 seconds)
18:26:56 × ph88 quits (~ph88@84-29-20-195.cable.dynamic.v4.ziggo.nl) (Quit: Leaving)
18:27:05 jpds2 joins (~jpds@gateway/tor-sasl/jpds)
18:27:12 Tuplanolla joins (~Tuplanoll@91-159-68-236.elisa-laajakaista.fi)
18:27:52 grnman_ joins (~michaelsc@c-66-176-3-51.hsd1.fl.comcast.net)
18:28:34 msavoritias joins (cb716af6b3@irc.cheogram.com)
18:28:43 <Guillaum[m]> At which point is it completely insane to build an `Ord` instance based on `Hashable`, something such as `compare a b = if a == b then EQ else compare (hash a) (hash b)`. (Actually, I'm thinking about something a bit more evoluted where if comparing on hash returns EQ, I'll use another salt.
18:28:43 <Guillaum[m]> X problem: I'm removing an Ord instance on a datastructure because it was buggy, not lawful, slow and leading to confusion and unfortunately somewhere in the codebase it does not build anymore because we use a Map based lru cache.
18:28:43 <Guillaum[m]> Or alternate question: is there a way to recover a "safe" Ord instance based on some other instances?
18:28:50 × jpds1 quits (~jpds@gateway/tor-sasl/jpds) (Ping timeout: 255 seconds)
18:37:26 <monochrom> If hash has collisions, then "compare (hash a) (hash b)" can give false equality.
18:37:41 <monochrom> If hash has no collisions, then "a == b" is unnecessary.
18:38:38 × alexherbo2 quits (~alexherbo@2a02-842a-8180-4601-7843-6da6-1e4a-20b9.rev.sfr.net) (Ping timeout: 260 seconds)
18:40:36 × oac quits (~oac@50-93-248-155.fttp.usinternet.com) (Remote host closed the connection)
18:40:58 <monochrom> Ideally you just s/Map/HashMap/ and use unordered-containers and you're done.
18:41:27 hochata joins (~user@user/hochata)
18:41:42 <monochrom> Since HashMap knows how to cope with collisions.
18:41:44 <c_wraith> ugh, is that my lru-cache?
18:42:16 <c_wraith> or I guess lrucache
18:44:04 × elain4 quits (~textual@static-71-251-226-194.rcmdva.fios.verizon.net) (Quit: Textual IRC Client: www.textualapp.com)
18:44:48 <c_wraith> I always wanted to go and make the backing type flexible, but every attempt more than doubled the complexity of the API
18:44:56 elain4 joins (~textual@static-71-251-226-194.rcmdva.fios.verizon.net)
18:45:21 <Guillaum[m]> c_wraith: that lrucaching, which handle colision with an internal Ord based datastructure
18:45:38 <c_wraith> ah, a different one
18:46:40 <Guillaum[m]> monochrom: and if I use a salt that I increase everytime `compare (hashWithSalt salt a) (hashWithSalt salt b)` returns `Eq`. I'm afraid about some weird behavior of the internal Map because this would not respect the property that if "a < b && b < c => a < c".
18:46:52 <Guillaum[m]> c_wraith: I'll have a look at `lru-cache`, maybe I may use it as a drop in replacment.
18:47:09 <c_wraith> nah, it wouldn't help. still needs Ord
18:47:24 <monochrom> c_wraith: Have you tried, God forbid, backpack? >:D
18:47:44 <c_wraith> no, that's a thing I haven't tried
18:47:52 <monochrom> Oh haha OK now you need both hashing and Ord.
18:49:10 <c_wraith> though I've taken to using backpack features to rename modules to get around changes between library versions.
18:50:00 <monochrom> A usual way of creating a private Ord and disallowing other people to use it is to create a newtype wrapper and write your Ord for the newtype only, and also not exporting the newtype, so no one else can use it so no harm done.
18:59:39 <Guillaum[m]> monochrom: that's true. However the `Ord` instance I need to write is HUGE, and I cannot use any generic approach, because actually this type is recursive. But I agree with this approach, maybe I'll write it manually.
19:11:49 pkal parts (soju@2a01:4f8:1c1c:bd2c::1) (Killed buffer)
19:20:45 × eggplantade quits (~Eggplanta@104-55-37-220.lightspeed.sntcca.sbcglobal.net) (Remote host closed the connection)
19:20:49 nate1 joins (~nate@98.45.169.16)
19:22:19 machinedgod joins (~machinedg@d198-53-218-113.abhsia.telus.net)
19:22:24 merijn joins (~merijn@c-001-001-006.client.esciencecenter.eduvpn.nl)
19:25:25 × nate1 quits (~nate@98.45.169.16) (Ping timeout: 240 seconds)
19:25:44 × elain4 quits (~textual@static-71-251-226-194.rcmdva.fios.verizon.net) (Quit: Textual IRC Client: www.textualapp.com)
19:38:39 × doyougnu quits (~doyougnu@cpe-74-69-132-225.stny.res.rr.com) (Ping timeout: 250 seconds)
19:53:49 × czy quits (~user@host-140-25.ilcub310.champaign.il.us.clients.pavlovmedia.net) (Remote host closed the connection)
19:56:14 <mmynsted[m]> I am looking at Data.Function.fix and am unclear about what this is doing and why it is useful. The example shown in the hackage docs makes some sense but not why I should want to do this.
19:56:25 × merijn quits (~merijn@c-001-001-006.client.esciencecenter.eduvpn.nl) (Ping timeout: 240 seconds)
19:57:36 <c_wraith> mmynsted[m]: It's an abstraction of general recursion, so it can be used for any loop. But you also never need to use it for anything.
19:57:45 × FinnElija quits (~finn_elij@user/finn-elija/x-0085643) (Remote host closed the connection)
19:57:52 × vglfr quits (~vglfr@88.155.49.118) (Ping timeout: 248 seconds)
19:58:14 FinnElija joins (~finn_elij@user/finn-elija/x-0085643)
19:58:50 <c_wraith> mmynsted[m]: as a practical use case, sometimes it's nice to declare a loop and run it in the same place without assigning a name to the loop
20:00:20 <monochrom> mmynsted[m]: See my http://www.vex.net/~trebla/haskell/fix.xhtml
20:00:38 <monochrom> Oh nevermind, you ask about use cases.
20:01:18 <monochrom> Well, I guess my article touches on that a little bit too. Anonymous recursion.
20:01:31 <monochrom> Anonymous, in-place recursion.
20:03:15 <monochrom> You may have: main = do { v <- newIORef initval; let { myloop = ... }; myloop; ... }
20:04:01 <monochrom> Sometimes you get tired of that, and this is a tiny little bit nicer: main = do { v <- newIORef initval; fix (\myloop -> ...); ... }
20:04:37 <monochrom> Sometimes both suck and we still don't know of an elegant way. :)
20:05:05 <c_wraith> on a recent bit of code, I ran into something like the pattern monochrom is describing, and I wanted to clean it up with a use of fix. So then I figured I might as well use it for all recursion in that module, because why use multiple different approaches?
20:05:43 Sciencentistguy7 joins (~sciencent@hacksoc/ordinary-member)
20:07:09 <c_wraith> (which is also the reason I ended up using STM for all references in the module, even the ones that were never going to be part of a contested transaction)
20:07:41 × Sciencentistguy quits (~sciencent@hacksoc/ordinary-member) (Ping timeout: 250 seconds)
20:07:42 Sciencentistguy7 is now known as Sciencentistguy
20:09:40 <yushyin> i have used it in AoC puzzles. as an argument to other higher order functions. keeps some of the solutions a one-liner, what would otherwise be more elegant with a helper function
20:10:17 <mmynsted[m]> Interesting
20:12:03 <mmynsted[m]> Still reading through the web link . . .
20:14:48 gnalzo joins (~gnalzo@2a01:e0a:498:fd50:fcc6:bb5d:489a:ce8c)
20:15:59 catch22 joins (~catch22@2406:3400:418:d7e0:67c:16ff:fe3e:b769)
20:16:24 eggplantade joins (~Eggplanta@104-55-37-220.lightspeed.sntcca.sbcglobal.net)
20:20:02 <mmynsted[m]> Okay, nice! Thanks to each of you! It abstracts away the recursion boilerplate making the function its self more visible.
20:21:12 <mmynsted[m]> I can see how this could be an improvement.
20:23:26 sammelweis joins (~quassel@2601:401:8200:2d4c:bd9:d04c:7f69:eb10)
20:24:39 <Guillaum[m]> mmynsted: one use case I like with fix is with anonymous recursion and caching / memoization. Imagine you want to cache a function such as `factorial :: Int -> Int`. That's "trivial" to write a "cache" function, something such as: "cache :: (Int -> Int) -> Int -> Int; cache f input = if input in "theCache" then read theCache input else output = f input; writeInTheCache output; ..." (That's pseudo code indeed).
20:25:28 <Guillaum[m]> mmynsted: have a look at https://hackage.haskell.org/package/memoize-1.1.2/docs/Data-Function-Memoize.html for such an API. However, for recursive function, you cannot apply this pattern, because it will cache the "outer" call, but not the recursive calls
20:26:20 <Guillaum[m]> mmynsted: If instead your recursion is written in a way that it can be used with "fix", then you can write a function (called memoFix in the above memoize package) which takes care of passing the memoized function to the recursion.
20:28:03 <mmynsted[m]> Right. I can see that. I am thinking of fibonacci sequence. The numbers are predictable and computed recursively, so I could store the function "result" in a tree or something. The recursive part could be abstracted using `fix`. . .
20:28:56 mmynsted[m] looks up Data.Function.Memoize
20:29:50 <Guillaum[m]> Yes, fibonacci is a perfect example of this. (but who uses fibonnaci in real life ? ;)
20:30:10 <mmynsted[m]> Hahaha good point
20:34:46 L29Ah parts (~L29Ah@wikipedia/L29Ah) ()
20:34:51 <mmynsted[m]> Wow, I am again so thankful I can go from the Hackage doc directly to the source.
20:35:56 <mmynsted[m]> There is much going on in Data.Function.Memoize but I can see how this works and would be useful (at least for fibonacci).
20:37:25 × AlexNoo quits (~AlexNoo@178.34.150.15) (Read error: Connection reset by peer)
20:38:04 AlexNoo joins (~AlexNoo@178.34.150.15)
20:38:20 × trev quits (~trev@user/trev) (Quit: trev)
20:38:21 × barcisz quits (~barcisz@79.191.65.29.ipv4.supernova.orange.pl) (Quit: Connection closed)
20:38:50 barcisz joins (~barcisz@79.191.65.29.ipv4.supernova.orange.pl)
20:39:31 × barcisz quits (~barcisz@79.191.65.29.ipv4.supernova.orange.pl) (Client Quit)
20:39:53 × AlexNoo quits (~AlexNoo@178.34.150.15) (Read error: Connection reset by peer)
20:39:54 barcisz joins (~barcisz@79.191.65.29.ipv4.supernova.orange.pl)
20:40:18 AlexNoo joins (~AlexNoo@178.34.150.15)
20:41:53 × AlexNoo quits (~AlexNoo@178.34.150.15) (Read error: Connection reset by peer)
20:42:19 AlexNoo joins (~AlexNoo@178.34.150.15)
20:42:46 × _ht quits (~Thunderbi@28-52-174-82.ftth.glasoperator.nl) (Quit: _ht)
20:43:20 waleee joins (~waleee@2001:9b0:21c:4000:5bf9:6515:c030:57b7)
20:44:57 × barcisz quits (~barcisz@79.191.65.29.ipv4.supernova.orange.pl) (Quit: Connection closed)
20:45:53 × AlexNoo quits (~AlexNoo@178.34.150.15) (Read error: Connection reset by peer)
20:46:23 AlexNoo joins (~AlexNoo@178.34.150.15)
20:49:04 × hochata quits (~user@user/hochata) (Ping timeout: 248 seconds)
20:50:25 wroathe joins (~wroathe@207-153-38-140.fttp.usinternet.com)
20:50:25 × wroathe quits (~wroathe@207-153-38-140.fttp.usinternet.com) (Changing host)
20:50:25 wroathe joins (~wroathe@user/wroathe)
20:52:43 merijn joins (~merijn@c-001-001-006.client.esciencecenter.eduvpn.nl)
20:54:24 <mauke> you can also do this with types: https://hackage.haskell.org/package/data-fix-0.3.2/docs/Data-Fix.html
20:56:02 rekahsoft joins (~rekahsoft@bras-base-orllon1122w-grc-04-174-88-193-177.dsl.bell.ca)
20:56:26 <mauke> instead of defining a recursive type (like `data IntTree = Leaf Int | Branch IntTree IntTree`) you can leave the recursion open: `data IntTreeX r = Leaf Int | Branch r r`
20:56:40 <mauke> and then IntTree = Fix IntTreeX
20:56:47 <mauke> (if you squint a bit)
20:57:21 × merijn quits (~merijn@c-001-001-006.client.esciencecenter.eduvpn.nl) (Ping timeout: 255 seconds)
20:58:05 × wroathe quits (~wroathe@user/wroathe) (Ping timeout: 246 seconds)
21:00:46 × takuan quits (~takuan@178-116-218-225.access.telenet.be) (Remote host closed the connection)
21:06:00 × coot quits (~coot@213.134.170.228) (Quit: coot)
21:06:11 <mmynsted[m]> :-) wow
21:06:38 barcisz joins (~barcisz@79.191.65.29.ipv4.supernova.orange.pl)
21:07:01 <mmynsted[m]> Also now fully distracted reading through http://www.vex.net/~trebla/haskell/index.xhtml
21:07:10 <monochrom> haha
21:07:27 × bgs quits (~bgs@212.85.160.171) (Remote host closed the connection)
21:08:34 <mmynsted[m]> I do not think I want to check my cabal defaults... I am sure they are wrong.
21:10:08 <geekosaur> if you haven't changed anything they're probably fine
21:10:45 <monochrom> No, some of the defaults actually make no sense for devs.
21:11:16 <monochrom> Make great sense for non-dev xmonad users, but not devs.
21:11:31 <monochrom> For example, don't build docs, don't build profiling versions.
21:12:55 <mmynsted[m]> profiling shows neither True nor False
21:13:09 <monochrom> For example, symlink exes, setting you up for future broken links because the origins are in some directory you will erase one day just because you move on to a new GHC version and ghcup suggests "you may like to erase that directory now, you don't need it any more".
21:13:29 <mmynsted[m]> Okay documentation is set to True. :-)
21:14:03 <monochrom> Although, profiling is now much more interesting than a boolean.
21:22:40 <mmynsted[m]> Hmm. I am interested in profiling properly. I am guessing that is a rabbit hole for another day.
21:23:12 × waleee quits (~waleee@2001:9b0:21c:4000:5bf9:6515:c030:57b7) (Ping timeout: 248 seconds)
21:28:29 waleee joins (~waleee@h-176-10-137-138.NA.cust.bahnhof.se)
21:38:17 <tomsmeding> setting profiling to true by default is not a good idea
21:38:22 <tomsmeding> slows down compilation considerably :p
21:38:41 <tomsmeding> iirc
21:39:30 <tomsmeding> or wait, that's false; it doesn't slow down _compilation_, it slows down your executables because it puts "check points" (cost centres, officially) at every function, meaning that ghc can do a lot less useful inlining
21:39:51 <tomsmeding> then recently there's -fprof-late or something like that, but details
21:44:32 <monochrom> True, I normally disable profiling too.
21:45:21 <monochrom> I also know how to cause profiling to convert a constant-space program to a linear-space program. >:)
21:46:39 <monochrom> Oh compilation is slowed down too, because turning on profiling means building two binaries, not just one.
21:46:49 × sammelweis quits (~quassel@2601:401:8200:2d4c:bd9:d04c:7f69:eb10) (Quit: No Ping reply in 180 seconds.)
21:46:51 <monochrom> Well, two binaries for libraries.
21:47:02 sammelweis joins (~quassel@2601:401:8200:2d4c:bd9:d04c:7f69:eb10)
21:47:26 <sm> yeah, it doubles compilation time (and disk space for deps)
21:48:08 <sm> or maybe deps are installed with profiled and non-profiled versions by default these days, not sure
21:48:28 Nolrai joins (~Nolrai@c-98-232-218-193.hsd1.or.comcast.net)
21:49:02 <geekosaur> that's --enable-library-profiling in cabal
21:50:38 × barcisz quits (~barcisz@79.191.65.29.ipv4.supernova.orange.pl) (Quit: Connection closed)
21:50:59 barcisz joins (~barcisz@79.191.65.29.ipv4.supernova.orange.pl)
21:52:32 × sammelweis quits (~quassel@2601:401:8200:2d4c:bd9:d04c:7f69:eb10) (Ping timeout: 248 seconds)
21:53:48 × Nolrai quits (~Nolrai@c-98-232-218-193.hsd1.or.comcast.net) (Quit: Client closed)
21:54:55 smallville7123_ joins (~JScript@cpe-172-193-72-46.qld.foxtel.net.au)
21:57:41 × JScript quits (~JScript@103.137.12.221) (Ping timeout: 256 seconds)
21:58:09 × gnalzo quits (~gnalzo@2a01:e0a:498:fd50:fcc6:bb5d:489a:ce8c) (Quit: WeeChat 3.8)
21:58:25 × rekahsoft quits (~rekahsoft@bras-base-orllon1122w-grc-04-174-88-193-177.dsl.bell.ca) (Ping timeout: 240 seconds)
21:59:45 × barcisz quits (~barcisz@79.191.65.29.ipv4.supernova.orange.pl) (Ping timeout: 240 seconds)
22:01:05 codaraxis joins (~codaraxis@user/codaraxis)
22:03:23 × Techcable quits (~Techcable@user/Techcable) (Ping timeout: 250 seconds)
22:07:12 × pharonix71 quits (~pharonix7@user/pharonix71) (Remote host closed the connection)
22:09:21 L29Ah joins (~L29Ah@wikipedia/L29Ah)
22:09:47 × jmdaemon quits (~jmdaemon@user/jmdaemon) (Ping timeout: 246 seconds)
22:15:45 × grnman_ quits (~michaelsc@c-66-176-3-51.hsd1.fl.comcast.net) (Ping timeout: 240 seconds)
22:19:29 dsrt^ joins (~dsrt@c-76-105-96-13.hsd1.ga.comcast.net)
22:27:20 [itchyjunk] joins (~itchyjunk@user/itchyjunk/x-7353470)
22:29:39 bratwurst joins (~dfadsva@2604:3d09:207f:f650::708a)
22:31:07 × acidjnk quits (~acidjnk@p200300d6e715c424008a03a563343fd8.dip0.t-ipconnect.de) (Ping timeout: 256 seconds)
22:32:30 jargon joins (~jargon@174-22-213-236.phnx.qwest.net)
22:32:50 falafel joins (~falafel@2603-8000-d700-115c-eb67-f21a-fab0-8b30.res6.spectrum.com)
22:33:13 × __monty__ quits (~toonn@user/toonn) (Quit: leaving)
22:35:13 × michalz quits (~michalz@185.246.207.203) (Remote host closed the connection)
22:35:25 slaydr joins (~slaydr@97-120-80-7.ptld.qwest.net)
22:37:17 <slaydr> I'm seeing something I've never seen before with ghcup's GHC9.4.2. When I compile a file (Main.hs) using ghc Main, I don't get the linking executable Main, just Main.hi and Main.o
22:40:05 <slaydr> If I load Main.hs into ghci, I can execute main there
22:41:04 <geekosaur> seems to work in 9.4.4
22:42:19 <slaydr> I tried GHC9.4.2 and GHC9.2.7
22:47:56 doyougnu joins (~doyougnu@cpe-74-69-132-225.stny.res.rr.com)
22:48:29 <slaydr> Ok. I found a discussion pointing to a problem with binutils-gold. I don't have that installed buy I do have ld.gold in /usr/bin/. Do you have ld.gold in /usr/bin/, geekosaur?
22:48:57 <slaydr> it's actually shown as ld.gold*
22:49:26 <geekosaur> yes, I do
22:49:31 × shriekingnoise quits (~shrieking@186.137.175.87) (Ping timeout: 240 seconds)
22:49:32 shriekingnoise_ joins (~shrieking@186.137.175.87)
22:50:09 <slaydr> thanks for checking.
22:51:26 <geekosaur> https://paste.tomsmeding.com/Sa1tj7i3
22:51:42 <geekosaur> and on my system (ubuntu) it comes from the binutils package
22:51:58 <geekosaur> don't assume that a package name automatically applies to your distribution…
22:53:06 <slaydr> Your right, it doesn't. Using Arcolinux
22:53:07 merijn joins (~merijn@c-001-001-006.client.esciencecenter.eduvpn.nl)
22:56:21 Techcable joins (~Techcable@user/Techcable)
23:03:13 × NiceBird quits (~NiceBird@185.133.111.196) (Ping timeout: 276 seconds)
23:04:28 Me-me joins (~Me-me@146.102.215.218.dyn.iprimus.net.au)
23:11:23 × mncheck quits (~mncheck@193.224.205.254) (Ping timeout: 246 seconds)
23:17:59 × eggplantade quits (~Eggplanta@104-55-37-220.lightspeed.sntcca.sbcglobal.net) (Remote host closed the connection)
23:20:59 × smallville7123_ quits (~JScript@cpe-172-193-72-46.qld.foxtel.net.au) (Read error: Connection reset by peer)
23:21:25 JScript joins (~JScript@103.137.12.133)
23:21:28 × JScript quits (~JScript@103.137.12.133) (Max SendQ exceeded)
23:21:59 JScript joins (~JScript@103.137.12.133)
23:22:20 nate1 joins (~nate@98.45.169.16)
23:25:07 szkl joins (uid110435@id-110435.uxbridge.irccloud.com)
23:25:43 × falafel quits (~falafel@2603-8000-d700-115c-eb67-f21a-fab0-8b30.res6.spectrum.com) (Ping timeout: 250 seconds)
23:26:45 × nate1 quits (~nate@98.45.169.16) (Ping timeout: 240 seconds)
23:27:05 × merijn quits (~merijn@c-001-001-006.client.esciencecenter.eduvpn.nl) (Ping timeout: 240 seconds)
23:33:50 × xff0x quits (~xff0x@2405:6580:b080:900:47f6:92dd:c4d9:cca7) (Ping timeout: 246 seconds)
23:34:14 × bratwurst quits (~dfadsva@2604:3d09:207f:f650::708a) (Quit: Leaving)
23:34:15 xff0x joins (~xff0x@178.255.149.135)
23:38:03 eggplantade joins (~Eggplanta@2600:1700:38c5:d800:6486:e69a:524e:7c3f)
23:40:20 sammelweis joins (~quassel@2601:401:8200:2d4c:bd9:d04c:7f69:eb10)
23:46:05 wroathe joins (~wroathe@207-153-38-140.fttp.usinternet.com)
23:46:06 × wroathe quits (~wroathe@207-153-38-140.fttp.usinternet.com) (Changing host)
23:46:06 wroathe joins (~wroathe@user/wroathe)
23:46:07 johnw parts (~johnw@76-234-69-149.lightspeed.frokca.sbcglobal.net) (ERC 5.4 (IRC client for GNU Emacs 28.2))
23:49:39 × xff0x quits (~xff0x@178.255.149.135) (Ping timeout: 260 seconds)
23:51:28 xff0x joins (~xff0x@2405:6580:b080:900:47f6:92dd:c4d9:cca7)
23:52:07 mauke_ joins (~mauke@user/mauke)
23:53:34 × mauke quits (~mauke@user/mauke) (Ping timeout: 252 seconds)
23:53:34 mauke_ is now known as mauke
23:56:52 × Tuplanolla quits (~Tuplanoll@91-159-68-236.elisa-laajakaista.fi) (Quit: Leaving.)
23:59:27 × sammelweis quits (~quassel@2601:401:8200:2d4c:bd9:d04c:7f69:eb10) (Ping timeout: 260 seconds)

All times are in UTC on 2023-04-18.