2024/07/05

2024-07-05 00:04:59 +0200TactfulCitrus(~al@2a02:8012:87a6:0:fbe0:6116:6e30:e047)
2024-07-05 00:08:33 +0200malte(~malte@mal.tc) (Read error: Connection reset by peer)
2024-07-05 00:13:51 +0200euleritian(~euleritia@ip4d16fc38.dynamic.kabel-deutschland.de) (Ping timeout: 268 seconds)
2024-07-05 00:17:27 +0200euleritian(~euleritia@dynamic-176-002-133-146.176.2.pool.telefonica.de)
2024-07-05 00:18:57 +0200malte(~malte@mal.tc)
2024-07-05 00:20:55 +0200destituion(~destituio@2a02:2121:6cb:fbc3:2f81:ee37:cafd:a2e0) (Ping timeout: 256 seconds)
2024-07-05 00:27:32 +0200takuan(~takuan@178-116-218-225.access.telenet.be) (Remote host closed the connection)
2024-07-05 00:28:52 +0200mreh(~matthew@host86-160-168-12.range86-160.btcentralplus.com) (Remote host closed the connection)
2024-07-05 00:41:48 +0200tdmarrrrrrrrrrra(~cd@c-98-242-74-66.hsd1.ga.comcast.net) (Ping timeout: 256 seconds)
2024-07-05 00:42:37 +0200tdmarrrrrrrrrrra(~cd@c-98-242-74-66.hsd1.ga.comcast.net)
2024-07-05 00:47:58 +0200tdmarrrrrrrrrrra(~cd@c-98-242-74-66.hsd1.ga.comcast.net) (Remote host closed the connection)
2024-07-05 01:10:06 +0200tomku|two(~tomku@syn-141-126-184-057.res.spectrum.com)
2024-07-05 01:12:08 +0200tomku(~tomku@syn-141-126-184-057.res.spectrum.com) (Ping timeout: 268 seconds)
2024-07-05 01:27:19 +0200oo_miguel(~Thunderbi@78.10.207.46) (Ping timeout: 260 seconds)
2024-07-05 01:43:49 +0200xdminsy(~xdminsy@117.147.70.231) (Quit: Konversation terminated!)
2024-07-05 01:44:14 +0200xdminsy(~xdminsy@117.147.70.231)
2024-07-05 01:45:10 +0200 <lain`> what row polymorphism library are people using? there's like 20 and most of them seem unmaintained
2024-07-05 01:50:34 +0200 <jackdk> I get by with HasField constraints from generic-lens
2024-07-05 01:54:57 +0200xff0x(~xff0x@2405:6580:b080:900:5277:df26:6b07:8b52) (Ping timeout: 272 seconds)
2024-07-05 02:02:49 +0200 <monochrom> I'm drunk so I think we need row polymorphism over those 20 row polymorphism libraries!
2024-07-05 02:02:54 +0200 <monochrom> @quote monochrom debate
2024-07-05 02:02:54 +0200 <lambdabot> monochrom says: All pointless debates can be settled by going polymorphic.
2024-07-05 02:05:47 +0200 <EvanR> celebrating america day?
2024-07-05 02:11:02 +0200gmg(~user@user/gehmehgeh) (Quit: Leaving)
2024-07-05 02:14:49 +0200sawilagar(~sawilagar@user/sawilagar) (Ping timeout: 256 seconds)
2024-07-05 02:16:19 +0200xff0x(~xff0x@2405:6580:b080:900:5277:df26:6b07:8b52)
2024-07-05 02:21:01 +0200pyooque(~puke@user/puke)
2024-07-05 02:21:01 +0200puke(~puke@user/puke) (Killed (copper.libera.chat (Nickname regained by services)))
2024-07-05 02:21:01 +0200pyooquepuke
2024-07-05 02:22:15 +0200puke(~puke@user/puke) (Max SendQ exceeded)
2024-07-05 02:23:30 +0200puke(~puke@user/puke)
2024-07-05 02:24:43 +0200puke(~puke@user/puke) (Max SendQ exceeded)
2024-07-05 02:26:00 +0200puke(~puke@user/puke)
2024-07-05 02:30:56 +0200califax(~califax@user/califx) (Quit: ZNC 1.8.2 - https://znc.in)
2024-07-05 02:31:20 +0200califax(~califax@user/califx)
2024-07-05 02:33:27 +0200malte(~malte@mal.tc) (Ping timeout: 252 seconds)
2024-07-05 02:34:45 +0200dysthesis(~dysthesis@user/dysthesis)
2024-07-05 02:34:45 +0200 <dmj`> lain`: you'd think the compiler would have that by now
2024-07-05 02:43:54 +0200malte(~malte@mal.tc)
2024-07-05 03:01:51 +0200Tuplanolla(~Tuplanoll@91-159-69-59.elisa-laajakaista.fi) (Quit: Leaving.)
2024-07-05 03:13:07 +0200tomku(~tomku@syn-141-126-184-057.res.spectrum.com)
2024-07-05 03:14:22 +0200tomku|two(~tomku@syn-141-126-184-057.res.spectrum.com) (Ping timeout: 264 seconds)
2024-07-05 03:15:14 +0200AlexNoo_(~AlexNoo@178.34.160.84)
2024-07-05 03:15:46 +0200AlexZenon(~alzenon@178.34.160.84) (Ping timeout: 268 seconds)
2024-07-05 03:16:57 +0200AlexNoo(~AlexNoo@178.34.160.84) (Ping timeout: 255 seconds)
2024-07-05 03:22:13 +0200AlexZenon(~alzenon@178.34.160.84)
2024-07-05 03:43:47 +0200joeyadams(~joeyadams@2603:6010:5100:2ed:ef2:fbb7:f346:1550) (Quit: Leaving)
2024-07-05 04:05:53 +0200 <jackdk> I have a record that contains a very large field, and code that tries to overwrite that field with an empty value (so I can keep the record around without a massive space leak), but nothing yet forces the thunk which does the update. Are there any common idioms for forcing a record field? At this stage there are no bang patterns in play
2024-07-05 04:07:01 +0200 <geekosaur> usually you just declare the field to be strict, I think
2024-07-05 04:07:06 +0200 <jackdk> I suppose I could do `let record' = record { field = mempty } in seq (field record') record'` but maybe there's something better?
2024-07-05 04:07:09 +0200 <jackdk> yeah ok
2024-07-05 04:16:49 +0200xff0x(~xff0x@2405:6580:b080:900:5277:df26:6b07:8b52) (Ping timeout: 268 seconds)
2024-07-05 04:25:21 +0200 <monochrom> https://vaibhavsagar.com/blog/2024/07/03/ghci-in-the-browser/ haha "as long as ... you are willing to download ~700MB of WASM."
2024-07-05 04:26:53 +0200 <haskellbridge> <vaibhavsagar> we really should do something about that
2024-07-05 04:27:18 +0200 <monochrom> ohai... heh
2024-07-05 04:27:45 +0200 <geekosaur> so you can kill the other half of maerwald's phone? 😈
2024-07-05 04:27:56 +0200 <monochrom> hahaha
2024-07-05 04:28:50 +0200 <haskellbridge> <vaibhavsagar> tbf I don't think that had anything to with the size of the WASM bundle
2024-07-05 04:28:59 +0200 <jackdk> vaibhavsagar: just tell them it's an LLM and they'll happily download binary blobs of arbitrary size
2024-07-05 04:29:21 +0200 <haskellbridge> <vaibhavsagar> that's a stunningly good idea
2024-07-05 04:29:42 +0200 <haskellbridge> <vaibhavsagar> LLMda
2024-07-05 04:29:58 +0200 <monochrom> Hot take: Haskell compiler : small language model :: C++ compiler :: large language model
2024-07-05 04:30:58 +0200 <haskellbridge> <vaibhavsagar> my WASM blob includes a full installation of g++
2024-07-05 04:31:10 +0200 <haskellbridge> <vaibhavsagar> so it should maybe be the other way round
2024-07-05 04:32:02 +0200 <monochrom> Oh I'm joking on (small/large language) not (small/large model) :)
2024-07-05 04:32:45 +0200 <monochrom> OK so GHC is a large model for a small language, sosad
2024-07-05 04:33:38 +0200dysthesis(~dysthesis@user/dysthesis) (Ping timeout: 260 seconds)
2024-07-05 04:38:51 +0200td_(~td@i5387093F.versanet.de) (Ping timeout: 255 seconds)
2024-07-05 04:40:28 +0200td_(~td@i53870914.versanet.de)
2024-07-05 04:51:37 +0200tomku(~tomku@syn-141-126-184-057.res.spectrum.com) (Remote host closed the connection)
2024-07-05 04:51:50 +0200tomku(~tomku@syn-141-126-184-057.res.spectrum.com)
2024-07-05 04:59:21 +0200Sgeo_(~Sgeo@user/sgeo)
2024-07-05 05:02:33 +0200Sgeo(~Sgeo@user/sgeo) (Ping timeout: 256 seconds)
2024-07-05 05:05:17 +0200khumba(~khumba@user/khumba) ()
2024-07-05 05:07:54 +0200xff0x(~xff0x@125x103x176x34.ap125.ftth.ucom.ne.jp)
2024-07-05 05:15:41 +0200aforemny_(~aforemny@i59F516DC.versanet.de)
2024-07-05 05:16:38 +0200aforemny(~aforemny@i59F516FF.versanet.de) (Ping timeout: 256 seconds)
2024-07-05 05:36:29 +0200tomku(~tomku@syn-141-126-184-057.res.spectrum.com) (Ping timeout: 240 seconds)
2024-07-05 05:38:45 +0200tomku(~tomku@syn-141-126-184-057.res.spectrum.com)
2024-07-05 05:43:12 +0200tomku(~tomku@syn-141-126-184-057.res.spectrum.com) (Ping timeout: 252 seconds)
2024-07-05 05:43:59 +0200tomku(~tomku@syn-141-126-184-057.res.spectrum.com)
2024-07-05 05:46:36 +0200 <haskellbridge> <aaron> jackdk: Why do you need to force the field? Don't you just need to force record'?
2024-07-05 05:47:43 +0200 <jackdk> aaron: it's a record update of a record update, so AIUI I'd need to force the outer field so the inner update happens promptly
2024-07-05 05:52:42 +0200 <haskellbridge> <aaron> Oh, as in updating a nested record?
2024-07-05 06:00:25 +0200 <haskellbridge> <aaron> jackdk: for forcing a field I guess you can do let !field = x in record { field }
2024-07-05 06:00:52 +0200 <jackdk> Sounds good, thanks
2024-07-05 06:07:56 +0200 <EvanR> force field
2024-07-05 06:10:17 +0200 <haskellbridge> <aaron> -XForceField
2024-07-05 06:12:51 +0200dunj3(~dunj3@kingdread.de) (Quit: ZNC 1.8.2+deb2+b1 - https://znc.in)
2024-07-05 06:13:30 +0200dunj3(~dunj3@kingdread.de)
2024-07-05 06:14:36 +0200Square(~Square@user/square) (Ping timeout: 268 seconds)
2024-07-05 06:18:55 +0200euleritian(~euleritia@dynamic-176-002-133-146.176.2.pool.telefonica.de) (Read error: Connection reset by peer)
2024-07-05 06:19:13 +0200euleritian(~euleritia@77.22.252.56)
2024-07-05 06:23:40 +0200 <haskellbridge> <aaron> jackdk: also if you use lenses you can do "set fieldLens $! value"
2024-07-05 06:24:19 +0200 <jackdk> that would still need the outer record to be forced via `seq` or something, right?
2024-07-05 06:27:47 +0200 <haskellbridge> <aaron> er, fieldLens would have to be the lens for the nested record, not the field within it
2024-07-05 06:28:50 +0200 <haskellbridge> <aaron> wonder if there's a combinator for making a lens strict
2024-07-05 06:40:35 +0200chexum(~quassel@gateway/tor-sasl/chexum) (Read error: Connection reset by peer)
2024-07-05 06:40:57 +0200chexum(~quassel@gateway/tor-sasl/chexum)
2024-07-05 06:56:23 +0200michalz(~michalz@185.246.207.200)
2024-07-05 06:58:41 +0200aaronv(~aaronv@user/aaronv)
2024-07-05 07:02:46 +0200dfg(~dfg@user/dfg) (Remote host closed the connection)
2024-07-05 07:03:36 +0200dfg(~dfg@dfg.rocks)
2024-07-05 07:03:37 +0200dfg(~dfg@dfg.rocks) (Changing host)
2024-07-05 07:03:37 +0200dfg(~dfg@user/dfg)
2024-07-05 07:04:56 +0200dfg(~dfg@user/dfg) (Remote host closed the connection)
2024-07-05 07:05:11 +0200dfg(~dfg@user/dfg)
2024-07-05 07:15:24 +0200rosco(~rosco@175.136.155.137)
2024-07-05 07:27:56 +0200euphores(~SASL_euph@user/euphores) (Quit: Leaving.)
2024-07-05 07:30:17 +0200Sgeo_(~Sgeo@user/sgeo) (Read error: Connection reset by peer)
2024-07-05 07:31:21 +0200Maeda(~Maeda@91-161-10-149.subs.proxad.net) (Quit: Yup, exiting...)
2024-07-05 07:44:08 +0200euphores(~SASL_euph@user/euphores)
2024-07-05 07:44:51 +0200acidjnk_new3(~acidjnk@p200300d6e72cfb277d28f4d2e7a5b949.dip0.t-ipconnect.de)
2024-07-05 07:45:38 +0200chexum(~quassel@gateway/tor-sasl/chexum) (Remote host closed the connection)
2024-07-05 07:45:54 +0200chexum(~quassel@gateway/tor-sasl/chexum)
2024-07-05 07:50:08 +0200takuan(~takuan@178-116-218-225.access.telenet.be)
2024-07-05 07:52:28 +0200tromp(~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl)
2024-07-05 07:54:09 +0200FragByte(~christian@user/fragbyte) (Ping timeout: 255 seconds)
2024-07-05 08:01:21 +0200tomku(~tomku@syn-141-126-184-057.res.spectrum.com) (Remote host closed the connection)
2024-07-05 08:01:39 +0200tomku(~tomku@syn-141-126-184-057.res.spectrum.com)
2024-07-05 08:08:48 +0200califax(~califax@user/califx) (Remote host closed the connection)
2024-07-05 08:09:11 +0200califax(~califax@user/califx)
2024-07-05 08:16:39 +0200Guest44(~Guest54@122.115.224.163)
2024-07-05 08:22:38 +0200phma(~phma@2001:5b0:211f:df58:db5:77f1:4b7c:c21a) (Read error: Connection reset by peer)
2024-07-05 08:23:02 +0200aaronv(~aaronv@user/aaronv) (Remote host closed the connection)
2024-07-05 08:23:21 +0200aaronv(~aaronv@user/aaronv)
2024-07-05 08:23:52 +0200phma(phma@2001:5b0:210f:75d8:5712:dd76:7969:de0f)
2024-07-05 08:28:50 +0200ft(~ft@p4fc2ab80.dip0.t-ipconnect.de) (Quit: leaving)
2024-07-05 08:40:51 +0200lortabac(~lortabac@78.211.149.172)
2024-07-05 08:45:44 +0200lortabac(~lortabac@78.211.149.172) (Ping timeout: 256 seconds)
2024-07-05 08:47:08 +0200lortabac(~lortabac@78.210.203.177)
2024-07-05 08:53:19 +0200tromp(~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) (Quit: My iMac has gone to sleep. ZZZzzz…)
2024-07-05 08:53:24 +0200Yumemi(~Yumemi@2001:bc8:47a0:1b14::1) (Quit: .)
2024-07-05 08:53:49 +0200Yumemi(~Yumemi@2001:bc8:47a0:1b14::1)
2024-07-05 08:55:42 +0200oo_miguel(~Thunderbi@78.10.207.46)
2024-07-05 09:03:48 +0200Guest44(~Guest54@122.115.224.163) (Ping timeout: 250 seconds)
2024-07-05 09:07:05 +0200gmg(~user@user/gehmehgeh)
2024-07-05 09:34:18 +0200codaraxis__(~codaraxis@user/codaraxis)
2024-07-05 09:35:04 +0200visilii(~visilii@213.24.125.33) (Quit: ZNC - https://znc.in)
2024-07-05 09:35:23 +0200visilii(~visilii@213.24.125.33)
2024-07-05 09:38:06 +0200codaraxis___(~codaraxis@user/codaraxis) (Ping timeout: 255 seconds)
2024-07-05 09:40:35 +0200aaronv(~aaronv@user/aaronv) (Ping timeout: 260 seconds)
2024-07-05 09:40:36 +0200sord937(~sord937@gateway/tor-sasl/sord937)
2024-07-05 09:42:21 +0200misterfish(~misterfis@094190207253.static.ipv4.heldenvannu.net)
2024-07-05 09:58:19 +0200lortabac(~lortabac@78.210.203.177) (Quit: WeeChat 4.2.2)
2024-07-05 09:59:54 +0200aaronv(~aaronv@user/aaronv)
2024-07-05 10:05:00 +0200tromp(~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl)
2024-07-05 10:05:37 +0200aaronv(~aaronv@user/aaronv) (Quit: Leaving)
2024-07-05 10:16:31 +0200chele(~chele@user/chele)
2024-07-05 10:18:18 +0200bliminse(~bliminse@user/bliminse) (Quit: leaving)
2024-07-05 10:27:24 +0200lortabac(~lortabac@78.210.203.177)
2024-07-05 10:32:53 +0200danse-nr3(~danse-nr3@151.47.146.33)
2024-07-05 10:40:13 +0200 <c_wraith> over an arbitrary data type?
2024-07-05 10:41:25 +0200Tuplanolla(~Tuplanoll@91-159-69-59.elisa-laajakaista.fi)
2024-07-05 10:43:52 +0200cfricke(~cfricke@user/cfricke)
2024-07-05 10:48:40 +0200danse-nr3(~danse-nr3@151.47.146.33) (Ping timeout: 246 seconds)
2024-07-05 10:49:41 +0200misterfish(~misterfis@094190207253.static.ipv4.heldenvannu.net) (Ping timeout: 240 seconds)
2024-07-05 10:55:56 +0200lxsameer(~lxsameer@Serene/lxsameer)
2024-07-05 10:56:35 +0200misterfish(~misterfis@094190207253.static.ipv4.heldenvannu.net)
2024-07-05 10:57:05 +0200danse-nr3(~danse-nr3@151.47.146.33)
2024-07-05 11:03:43 +0200 <c_wraith> Turns out you can write one, within certain limitations. nevermind me being like 5 hours late.
2024-07-05 11:03:44 +0200__monty__(~toonn@user/toonn)
2024-07-05 11:14:26 +0200 <albet70> there's a list [1..99], get the summary of items from right to left below N, when N is 200, its [98,99], except scanr and traverse, is there other good way?
2024-07-05 11:15:03 +0200qqq(~qqq@92.43.167.61)
2024-07-05 11:16:20 +0200zetef(~quassel@2a02:2f00:5202:1200:3fa2:e908:b522:fa2f)
2024-07-05 11:16:20 +0200zetef(~quassel@2a02:2f00:5202:1200:3fa2:e908:b522:fa2f) (Client Quit)
2024-07-05 11:19:14 +0200qqq(~qqq@92.43.167.61) (Client Quit)
2024-07-05 11:21:50 +0200 <ncf> wut
2024-07-05 11:22:09 +0200sawilagar(~sawilagar@user/sawilagar)
2024-07-05 11:22:15 +0200qqe(~qqq@92.43.167.61)
2024-07-05 11:27:32 +0200 <[exa]> albet70: walk the "diagonal" of the matrix of all sums (that gives you roughly O(n) alg)
2024-07-05 11:27:52 +0200driib3(~driib@vmi931078.contaboserver.net) (Quit: The Lounge - https://thelounge.chat)
2024-07-05 11:28:26 +0200driib3(~driib@vmi931078.contaboserver.net)
2024-07-05 11:28:27 +0200 <[exa]> albet70: funnily, https://en.wikipedia.org/wiki/3SUM
2024-07-05 11:32:40 +0200qqe(~qqq@92.43.167.61) (Quit: leaving)
2024-07-05 11:33:07 +0200qqe(~qqq@92.43.167.61)
2024-07-05 11:34:22 +0200flounders_(~flounders@24.246.176.178) (Quit: WeeChat 4.1.2)
2024-07-05 11:34:25 +0200qqe(~qqq@92.43.167.61) (Client Quit)
2024-07-05 11:34:43 +0200qqe(~qqq@92.43.167.61)
2024-07-05 11:40:42 +0200mikess(~mikess@user/mikess) (Ping timeout: 252 seconds)
2024-07-05 11:44:08 +0200bliminse(~bliminse@user/bliminse)
2024-07-05 11:57:47 +0200mzg(mzg@abusers.hu) (Remote host closed the connection)
2024-07-05 11:59:03 +0200tzh(~tzh@c-76-115-131-146.hsd1.or.comcast.net) (Quit: zzz)
2024-07-05 12:01:28 +0200lortabac(~lortabac@78.210.203.177) (Quit: WeeChat 4.2.2)
2024-07-05 12:09:50 +0200tromp(~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) (Quit: My iMac has gone to sleep. ZZZzzz…)
2024-07-05 12:13:36 +0200mzg(~mzg@abusers.hu)
2024-07-05 12:16:47 +0200rosco(~rosco@175.136.155.137) (Quit: Lost terminal)
2024-07-05 12:18:29 +0200mzg(~mzg@abusers.hu) (Ping timeout: 240 seconds)
2024-07-05 12:23:46 +0200mzg(mzg@abusers.hu)
2024-07-05 12:24:34 +0200misterfish(~misterfis@094190207253.static.ipv4.heldenvannu.net) (Ping timeout: 264 seconds)
2024-07-05 12:24:40 +0200vpan(~vpan@212.117.1.172)
2024-07-05 12:28:11 +0200ubert(~Thunderbi@p200300ecdf008f4b372e113240d6a5e8.dip0.t-ipconnect.de)
2024-07-05 12:31:06 +0200Fijxu(~Fijxu@user/fijxu) (Quit: XD!!)
2024-07-05 12:33:27 +0200Fijxu(~Fijxu@user/fijxu)
2024-07-05 12:54:15 +0200xff0x(~xff0x@125x103x176x34.ap125.ftth.ucom.ne.jp) (Ping timeout: 264 seconds)
2024-07-05 13:13:31 +0200lortabac(~lortabac@78.210.203.177)
2024-07-05 13:22:10 +0200danse-nr3(~danse-nr3@151.47.146.33) (Ping timeout: 264 seconds)
2024-07-05 13:23:40 +0200wlhn(~wlhn@dl46fx8hbfttwvhb-h1ly-3.rev.dnainternet.fi)
2024-07-05 13:26:38 +0200waleee(~waleee@h-176-10-144-38.NA.cust.bahnhof.se)
2024-07-05 13:40:32 +0200sp1ff(~user@c-73-11-70-111.hsd1.wa.comcast.net) (Read error: Connection reset by peer)
2024-07-05 13:59:56 +0200tromp(~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl)
2024-07-05 14:03:15 +0200misterfish(~misterfis@84.53.85.146)
2024-07-05 14:05:11 +0200euleritian(~euleritia@77.22.252.56) (Ping timeout: 268 seconds)
2024-07-05 14:06:12 +0200euleritian(~euleritia@dynamic-176-002-131-122.176.2.pool.telefonica.de)
2024-07-05 14:08:13 +0200euleritian(~euleritia@dynamic-176-002-131-122.176.2.pool.telefonica.de) (Read error: Connection reset by peer)
2024-07-05 14:08:39 +0200euleritian(~euleritia@ip4d16fc38.dynamic.kabel-deutschland.de)
2024-07-05 14:10:18 +0200noumenon(~noumenon@2a01:799:cd8:e700:aa7e:eaff:fede:ff94)
2024-07-05 14:23:33 +0200meooow_(~meooow@2400:6180:100:d0::ad9:e001) (Quit: q)
2024-07-05 14:23:48 +0200meooow(~meooow@165.232.184.169)
2024-07-05 14:24:46 +0200Square(~Square@user/square)
2024-07-05 14:29:59 +0200danse-nr3(~danse-nr3@151.47.162.188)
2024-07-05 14:35:57 +0200waleee(~waleee@h-176-10-144-38.NA.cust.bahnhof.se) (Ping timeout: 268 seconds)
2024-07-05 14:35:58 +0200euleritian(~euleritia@ip4d16fc38.dynamic.kabel-deutschland.de) (Ping timeout: 264 seconds)
2024-07-05 14:36:38 +0200euleritian(~euleritia@dynamic-176-002-131-122.176.2.pool.telefonica.de)
2024-07-05 14:38:14 +0200danse-nr3(~danse-nr3@151.47.162.188) (Remote host closed the connection)
2024-07-05 14:38:39 +0200danse-nr3(~danse-nr3@151.47.162.188)
2024-07-05 14:50:22 +0200RedFlamingos(~RedFlamin@user/RedFlamingos) (Ping timeout: 264 seconds)
2024-07-05 15:01:53 +0200lortabac(~lortabac@78.210.203.177) (Quit: WeeChat 4.2.2)
2024-07-05 15:13:49 +0200Ranhir(~Ranhir@157.97.53.139) (Quit: KVIrc 5.0.0 Aria http://www.kvirc.net/)
2024-07-05 15:16:23 +0200 <haskellbridge> <thirdofmay18081814goya> what's a good data type for a form that has specified fields? two of these fields are subforms and the rest of the fields are booleans, integers or string. it's a google compute instance declaration
2024-07-05 15:17:41 +0200ystael(~ystael@user/ystael)
2024-07-05 15:21:09 +0200lol__(~lol@2603:3016:1e01:b940:39da:d80d:3ccf:6868)
2024-07-05 15:21:12 +0200Leary(~Leary@user/Leary/x-0910699) (Remote host closed the connection)
2024-07-05 15:21:13 +0200zmt01(~zmt00@user/zmt00)
2024-07-05 15:21:26 +0200Leary(~Leary@user/Leary/x-0910699)
2024-07-05 15:21:34 +0200misterfish(~misterfis@84.53.85.146) (Ping timeout: 264 seconds)
2024-07-05 15:22:18 +0200lain`(lain`@user/lain/x-9874679) (Read error: Connection reset by peer)
2024-07-05 15:22:33 +0200lain`(lain`@user/lain/x-9874679)
2024-07-05 15:22:52 +0200misterfish(~misterfis@84.53.85.146)
2024-07-05 15:24:31 +0200lol_(~lol@2603:3016:1e01:b940:61bf:729d:7923:1c8b) (Ping timeout: 260 seconds)
2024-07-05 15:24:33 +0200zmt00(~zmt00@user/zmt00) (Ping timeout: 260 seconds)
2024-07-05 15:26:00 +0200Ranhir(~Ranhir@157.97.53.139)
2024-07-05 15:26:47 +0200AlexNoo_AlexNoo
2024-07-05 15:27:44 +0200xff0x(~xff0x@2405:6580:b080:900:c64a:ce6b:6071:dfe5)
2024-07-05 15:32:23 +0200Square(~Square@user/square) (Ping timeout: 268 seconds)
2024-07-05 15:41:20 +0200tomku(~tomku@syn-141-126-184-057.res.spectrum.com) (Remote host closed the connection)
2024-07-05 15:41:28 +0200 <stefan-__> when having shared values as in https://play.haskell.org/saved/1cyqlqTB .. what is the preferred procedere when for example "item1.label" needs to get updated?
2024-07-05 15:41:35 +0200tomku(~tomku@syn-141-126-184-057.res.spectrum.com)
2024-07-05 15:43:51 +0200Camdar(~Camdar@n11923770052.netvigator.com)
2024-07-05 15:44:25 +0200 <Camdar> hello, is this somewhere I can get help with megaparsec
2024-07-05 15:44:25 +0200 <stefan-__> or would it for example better to just use the identifiers in the tree/list, together with a "Map ItemId Item"?
2024-07-05 15:45:38 +0200incertia(~incertia@209.122.137.252) (Ping timeout: 268 seconds)
2024-07-05 15:49:50 +0200bitdex(~bitdex@gateway/tor-sasl/bitdex) (Ping timeout: 260 seconds)
2024-07-05 15:52:50 +0200bitdex(~bitdex@gateway/tor-sasl/bitdex)
2024-07-05 15:54:49 +0200waleee(~waleee@h-176-10-144-38.NA.cust.bahnhof.se)
2024-07-05 15:55:27 +0200Camdar(~Camdar@n11923770052.netvigator.com) (Quit: Client closed)
2024-07-05 16:07:31 +0200 <stefan-__> Cam
2024-07-05 16:07:43 +0200 <stefan-__> oh, already gone
2024-07-05 16:12:34 +0200waleee(~waleee@h-176-10-144-38.NA.cust.bahnhof.se) (Ping timeout: 264 seconds)
2024-07-05 16:14:55 +0200ft(~ft@p4fc2ab80.dip0.t-ipconnect.de)
2024-07-05 16:25:18 +0200sord937(~sord937@gateway/tor-sasl/sord937) (Ping timeout: 260 seconds)
2024-07-05 16:26:36 +0200soverysour(~soverysou@81.196.150.219)
2024-07-05 16:26:37 +0200soverysour(~soverysou@81.196.150.219) (Changing host)
2024-07-05 16:26:37 +0200soverysour(~soverysou@user/soverysour)
2024-07-05 16:29:04 +0200sord937(~sord937@gateway/tor-sasl/sord937)
2024-07-05 16:31:04 +0200 <haskellbridge> <thirdofmay18081814goya> what's a state-of-the-art implementation of a parser i can use as a reference to improve my haskell
2024-07-05 16:34:21 +0200soverysour(~soverysou@user/soverysour) (Ping timeout: 268 seconds)
2024-07-05 16:44:19 +0200danse-nr3(~danse-nr3@151.47.162.188) (Ping timeout: 260 seconds)
2024-07-05 16:46:29 +0200misterfish(~misterfis@84.53.85.146) (Ping timeout: 240 seconds)
2024-07-05 16:57:25 +0200Sgeo(~Sgeo@user/sgeo)
2024-07-05 16:58:23 +0200mesaoptimizer(~mesaoptim@user/PapuaHardyNet) (Quit: mesaoptimizer)
2024-07-05 16:58:32 +0200mesaoptimizer(~mesaoptim@user/PapuaHardyNet)
2024-07-05 16:59:50 +0200bitdex(~bitdex@gateway/tor-sasl/bitdex) (Ping timeout: 260 seconds)
2024-07-05 17:02:19 +0200bitdex(~bitdex@gateway/tor-sasl/bitdex)
2024-07-05 17:03:33 +0200Sgeo(~Sgeo@user/sgeo) (Read error: Connection reset by peer)
2024-07-05 17:08:03 +0200euleritian(~euleritia@dynamic-176-002-131-122.176.2.pool.telefonica.de) (Ping timeout: 264 seconds)
2024-07-05 17:09:41 +0200euleritian(~euleritia@dynamic-176-002-131-122.176.2.pool.telefonica.de)
2024-07-05 17:10:34 +0200cfricke(~cfricke@user/cfricke) (Quit: WeeChat 4.2.2)
2024-07-05 17:10:46 +0200Joao[3](~Joao003@190.108.99.178)
2024-07-05 17:13:53 +0200Joao[3](~Joao003@190.108.99.178) (Read error: Connection reset by peer)
2024-07-05 17:14:52 +0200Joao[3](~Joao003@190.108.99.178)
2024-07-05 17:16:34 +0200soverysour(~soverysou@user/soverysour)
2024-07-05 17:17:51 +0200tomku(~tomku@syn-141-126-184-057.res.spectrum.com) (Ping timeout: 252 seconds)
2024-07-05 17:19:08 +0200ubert1(~Thunderbi@p200300ecdf008f96cbf35d83d33dbb30.dip0.t-ipconnect.de)
2024-07-05 17:19:23 +0200tomku(~tomku@syn-141-126-184-057.res.spectrum.com)
2024-07-05 17:19:59 +0200danse-nr3(~danse-nr3@151.47.162.188)
2024-07-05 17:20:00 +0200ubert(~Thunderbi@p200300ecdf008f4b372e113240d6a5e8.dip0.t-ipconnect.de) (Ping timeout: 268 seconds)
2024-07-05 17:20:00 +0200ubert1ubert
2024-07-05 17:21:25 +0200Sgeo(~Sgeo@user/sgeo)
2024-07-05 17:21:27 +0200danse-nr3(~danse-nr3@151.47.162.188) (Remote host closed the connection)
2024-07-05 17:21:32 +0200soverysour(~soverysou@user/soverysour) (Ping timeout: 268 seconds)
2024-07-05 17:21:51 +0200danse-nr3(~danse-nr3@151.47.162.188)
2024-07-05 17:22:37 +0200Joao[3](~Joao003@190.108.99.178) (Quit: Bye!)
2024-07-05 17:24:18 +0200soverysour(~soverysou@81.196.150.219)
2024-07-05 17:24:19 +0200soverysour(~soverysou@81.196.150.219) (Changing host)
2024-07-05 17:24:19 +0200soverysour(~soverysou@user/soverysour)
2024-07-05 17:34:20 +0200myxos(~myxos@syn-065-028-251-121.res.spectrum.com) (Remote host closed the connection)
2024-07-05 17:34:23 +0200robotsnowfall(~robotsnow@user/robotsnowfall) (Quit: ZNC 1.9.0 - https://znc.in)
2024-07-05 17:34:46 +0200robotsnowfall(~robotsnow@user/robotsnowfall)
2024-07-05 17:35:02 +0200myxos(~myxos@syn-065-028-251-121.res.spectrum.com)
2024-07-05 17:35:28 +0200robotsnowfall(~robotsnow@user/robotsnowfall) (Client Quit)
2024-07-05 17:36:04 +0200robotsnowfall(~robotsnow@user/robotsnowfall)
2024-07-05 17:38:48 +0200incertia(~incertia@209.122.137.252)
2024-07-05 17:43:34 +0200danse-nr3(~danse-nr3@151.47.162.188) (Read error: Connection reset by peer)
2024-07-05 17:43:50 +0200danse-nr3(~danse-nr3@151.47.148.201)
2024-07-05 17:47:16 +0200chele(~chele@user/chele) (Remote host closed the connection)
2024-07-05 17:52:54 +0200robotsnowfall(~robotsnow@user/robotsnowfall) (Quit: ZNC 1.9.1 - https://znc.in)
2024-07-05 17:53:25 +0200robotsnowfall(~robotsnow@user/robotsnowfall)
2024-07-05 18:01:21 +0200tromp(~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) (Quit: My iMac has gone to sleep. ZZZzzz…)
2024-07-05 18:03:48 +0200bitdex(~bitdex@gateway/tor-sasl/bitdex) (Remote host closed the connection)
2024-07-05 18:05:14 +0200bitdex(~bitdex@gateway/tor-sasl/bitdex)
2024-07-05 18:05:19 +0200robotsnowfall(~robotsnow@user/robotsnowfall) (Quit: ZNC 1.9.1 - https://znc.in)
2024-07-05 18:06:54 +0200robotsnowfall(~robotsnow@user/robotsnowfall)
2024-07-05 18:08:16 +0200noumenon(~noumenon@2a01:799:cd8:e700:aa7e:eaff:fede:ff94) (Quit: Leaving)
2024-07-05 18:10:12 +0200mikess(~mikess@user/mikess)
2024-07-05 18:12:15 +0200robotsnowfall(~robotsnow@user/robotsnowfall) (Quit: ZNC 1.9.1 - https://znc.in)
2024-07-05 18:13:33 +0200robotsnowfall(~robotsnow@user/robotsnowfall)
2024-07-05 18:13:49 +0200 <hololeap> is it considered bad practice to pass a non-unary constructor around with "undefined" where the data should be? I was considering doing this so that one module decides which constructor is used, then another module fills in the blanks in a "case" statement
2024-07-05 18:15:07 +0200 <c_wraith> there is probably a better way for most use cases.
2024-07-05 18:15:46 +0200 <hololeap> I also know of e.g. barbies which would give a way to have the same data structures in uninitialized/initialized states, but it feels like overkill
2024-07-05 18:15:52 +0200 <c_wraith> also, that doesn't always work. There are constructors with strict fields.
2024-07-05 18:16:47 +0200 <hololeap> ok, it's probably best then to choose the constructor in the same module that is filling in the data
2024-07-05 18:16:59 +0200 <hololeap> just spitballing ideas
2024-07-05 18:17:24 +0200qqe(~qqq@92.43.167.61) (Ping timeout: 255 seconds)
2024-07-05 18:17:25 +0200 <c_wraith> I still don't really understand what you want.
2024-07-05 18:17:29 +0200 <danse-nr3> me neither
2024-07-05 18:17:35 +0200 <hololeap> c_wraith: it sounds like you do
2024-07-05 18:18:05 +0200 <c_wraith> well I understand what you're suggesting as a solution. But I don't understand the problem you're suggesting it as a solution to
2024-07-05 18:19:51 +0200 <danse-nr3> for Either Int Int, for instance, you can have one function opting for Left and Right and another function providing the Int, just to make a silly example about what you described
2024-07-05 18:20:28 +0200 <haskellbridge> <thirdofmay18081814goya> what are some very small haskell repositories that exemplify good haskell
2024-07-05 18:21:29 +0200 <danse-nr3> how can they "exemplify good haskell" when, by being very small, they would include just a fraction of it?
2024-07-05 18:21:57 +0200 <c_wraith> hololeap: like, talking about uninitialized states makes me think you're trying to avoid having different data types for request/response to some api. Is that even remotely close?
2024-07-05 18:21:58 +0200tomku(~tomku@syn-141-126-184-057.res.spectrum.com) (Ping timeout: 268 seconds)
2024-07-05 18:22:22 +0200 <hololeap> the way I have this program organized is to have a big ADT in its own module that represents all the valid modes of the program, and the actual work being done is separated into other modules. my original idea was to have the ADT module also include conversion functions that translate the ADT to types that are specialized for the other parts of the code. however the ADT module does not contain any of the code necessary to fill in the blanks for these
2024-07-05 18:22:22 +0200 <hololeap> constructors
2024-07-05 18:23:10 +0200 <hololeap> it's not really a "problem" I'm trying to solve, just painting myself into a corner with the way I'm organizing things :p
2024-07-05 18:23:35 +0200tomku(~tomku@syn-141-126-184-057.res.spectrum.com)
2024-07-05 18:24:07 +0200 <haskellbridge> <thirdofmay18081814goya> danse-nr3: personal preferences, instance of bits of haskell code that follow best practices
2024-07-05 18:24:12 +0200 <hololeap> hope that made sense
2024-07-05 18:24:23 +0200 <haskellbridge> <thirdofmay18081814goya> * instances of bits of haskell code that follow best practices according to whoever
2024-07-05 18:24:44 +0200 <danse-nr3> that would just be misleading
2024-07-05 18:25:07 +0200tromp(~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl)
2024-07-05 18:25:53 +0200 <danse-nr3> if not deceptive
2024-07-05 18:25:58 +0200 <c_wraith> hololeap: In some sense it's bad for type safety to make uninitialized values the same type as usable values.
2024-07-05 18:26:45 +0200akira-sijk(~akira-sij@27.47.33.155)
2024-07-05 18:27:33 +0200 <danse-nr3> but also it sounds like a problem in organising dependencies. This big ADT type is made of smaller types i guess. Do conversions need to take the whole ADT in order to produce what is modularly needed?
2024-07-05 18:28:16 +0200 <c_wraith> hololeap: But I'm overall unimpressed with the barbies-like approaches as well. I find they really lack the granularity to express "I know these three fields, but not those five"
2024-07-05 18:28:42 +0200 <hololeap> good points
2024-07-05 18:28:46 +0200soverysour(~soverysou@user/soverysour) (Ping timeout: 264 seconds)
2024-07-05 18:29:07 +0200akira-sijk(~akira-sij@27.47.33.155) ()
2024-07-05 18:29:16 +0200rdcdr(~rdcdr@user/rdcdr) (Quit: ZNC 1.8.2+deb3.1 - https://znc.in)
2024-07-05 18:29:26 +0200destituion(~destituio@2a02:2121:6bc:1a95:cb10:e092:4032:88f5)
2024-07-05 18:29:44 +0200 <c_wraith> in the end, I just create new types for new cases. If all I know are these three fields, I dig into *why* that's true, then create a new data type that contains those three fields and document when it's the right thing to use.
2024-07-05 18:30:04 +0200destituion(~destituio@2a02:2121:6bc:1a95:cb10:e092:4032:88f5) (Remote host closed the connection)
2024-07-05 18:31:03 +0200 <c_wraith> If I'm getting a lot of ad-hoc types out of that, it's time to consider refactoring so that the cases all follow clearly-delineated patterns
2024-07-05 18:31:08 +0200 <hololeap> danse-nr3: to some degree, yes. it's a CLI program and the way that arguments interact with each other is fairly complex, so I have it separated into: 1) a model of the possible command line options given by the user 2) conversion/parsing/validation to an ADT of possible valid modes of the program 3) conversion of this ADT to types that control the behavior of other parts that are doing the actual work
2024-07-05 18:32:05 +0200 <hololeap> anyway, I think the most straightforward thing to do here is to move step 3 to the same modules where the work is being done
2024-07-05 18:33:19 +0200 <hololeap> thanks for the insights c_wraith, danse-nr3
2024-07-05 18:33:24 +0200 <danse-nr3> it's three types where i would personally wish to have just one that makes sense. Arguments interacting with each other in a fairly complex way is probably not the best usability
2024-07-05 18:34:37 +0200 <danse-nr3> once you can get a top level sum type, for instance, that paves the path towards eventually splitting commands into separate concerns
2024-07-05 18:37:32 +0200 <hololeap> true, but it's an old open source utility that I'm working on, so I'm sort of evolving it slowly in the direction it needs to go, rather than just rewriting it, partially because I'm dogfooding it and assessing things as I go. the feature drift is a bit of a necessary evil at this point, and keeping the command line similar to what it has been in the past is a priority just so I don't confuse current users of it
2024-07-05 18:38:20 +0200euleritian(~euleritia@dynamic-176-002-131-122.176.2.pool.telefonica.de) (Read error: Connection reset by peer)
2024-07-05 18:38:37 +0200euleritian(~euleritia@ip4d16fc38.dynamic.kabel-deutschland.de)
2024-07-05 18:39:08 +0200 <hololeap> it also has the requirement of only depending on packages that come bundled with GHC, so for optparse-applicative esque commands, I'd have to roll my own
2024-07-05 18:40:59 +0200vpan(~vpan@212.117.1.172) (Quit: Leaving.)
2024-07-05 18:41:54 +0200 <hololeap> anyway, I really just wanted some advice on the uninitialized constructor idea, and I got it, so I'll get back to coding. thanks again!
2024-07-05 18:42:08 +0200 <danse-nr3> \o good work
2024-07-05 18:42:58 +0200 <haskellbridge> <sm> command line parsing gets tricky !
2024-07-05 18:47:08 +0200soverysour(~soverysou@user/soverysour)
2024-07-05 18:48:34 +0200bitdex(~bitdex@gateway/tor-sasl/bitdex) (Ping timeout: 260 seconds)
2024-07-05 18:51:16 +0200sord937(~sord937@gateway/tor-sasl/sord937) (Quit: sord937)
2024-07-05 18:53:47 +0200destituion(~destituio@2a02:2121:6bc:1a95:cb10:e092:4032:88f5)
2024-07-05 18:55:44 +0200misterfish(~misterfis@84.53.85.146)
2024-07-05 19:06:33 +0200tromp(~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) (Quit: My iMac has gone to sleep. ZZZzzz…)
2024-07-05 19:12:29 +0200pavonia(~user@user/siracusa) (Quit: Bye!)
2024-07-05 19:20:14 +0200tromp(~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl)
2024-07-05 19:32:33 +0200L29Ah(~L29Ah@wikipedia/L29Ah) ()
2024-07-05 19:35:18 +0200madhavanmiui(~madhavanm@2409:40f4:304d:5ad7:8000::)
2024-07-05 19:35:59 +0200madhavanmiui(~madhavanm@2409:40f4:304d:5ad7:8000::) (Client Quit)
2024-07-05 19:37:29 +0200codaraxis___(~codaraxis@user/codaraxis)
2024-07-05 19:41:31 +0200codaraxis__(~codaraxis@user/codaraxis) (Ping timeout: 268 seconds)
2024-07-05 19:47:53 +0200rdcdr(~rdcdr@user/rdcdr)
2024-07-05 19:52:31 +0200danse-nr3(~danse-nr3@151.47.148.201) (Quit: Leaving)
2024-07-05 19:57:10 +0200Inst(~Inst@user/Inst)
2024-07-05 19:57:40 +0200 <Inst> just curious, when you have isString or isList typeclasses, are these hardcoded literals or, when GHC gets to the literals, it generates a String or List and does the conversion as needed?
2024-07-05 20:00:17 +0200nurupo(~nurupo.ga@user/nurupo) (Quit: nurupo.ga)
2024-07-05 20:00:36 +0200nurupo(~nurupo.ga@user/nurupo)
2024-07-05 20:02:01 +0200 <geekosaur> it compiles them to fromString/fromList called on a normal string/list
2024-07-05 20:02:22 +0200 <geekosaur> much as it does for numeric literals (fromInteger/fromRational)
2024-07-05 20:13:00 +0200rdcdr(~rdcdr@user/rdcdr) (Quit: ZNC 1.8.2+deb3.1 - https://znc.in)
2024-07-05 20:15:07 +0200soverysour(~soverysou@user/soverysour) (Ping timeout: 268 seconds)
2024-07-05 20:15:17 +0200fun-safe-math(~fun-safe-@24.21.106.247)
2024-07-05 20:16:04 +0200 <haskellbridge> <iqubic (she/her)> What do people recommend for generating random values? I know that some of this stuff will have to be in IO, but I think most of the functions can be pure by doing something like "generator -> (Int, generator)"
2024-07-05 20:17:19 +0200 <probie> Inst: "foo :: Text" is the same as if you'd written "(fromString "foo") :: Text", however that doesn't actually mean there will be a `String` in the compiled code. GHC normally does a very good job optimising it all away and just leaving you with the `Text` value you'd expect
2024-07-05 20:17:52 +0200 <haskellbridge> <iqubic (she/her)> Overloaded strings are pretty OP.
2024-07-05 20:18:49 +0200Lord_of_Life_(~Lord@user/lord-of-life/x-2819915)
2024-07-05 20:19:10 +0200Lord_of_Life(~Lord@user/lord-of-life/x-2819915) (Ping timeout: 246 seconds)
2024-07-05 20:21:09 +0200noumenon(~noumenon@2a01:799:cd8:e700:aa7e:eaff:fede:ff94)
2024-07-05 20:21:46 +0200Lord_of_Life_Lord_of_Life
2024-07-05 20:26:00 +0200 <jle`> was there a recent ghc version where $$(myTH) can now be written as $$myTH ? or was it always permitted and i just didn't know
2024-07-05 20:26:37 +0200 <haskellbridge> <iqubic (she/her)> Jle`: You're back!!!
2024-07-05 20:27:14 +0200 <jle`> hi! i have been floating in and out for the past few months heh
2024-07-05 20:32:22 +0200rdcdr(~rdcdr@user/rdcdr)
2024-07-05 20:37:02 +0200 <geekosaur> jle`, that's always ttbomk been permitted
2024-07-05 20:37:36 +0200 <dmj`> if its a function I think it needs parens $(myTH a b), o/w it can just be $myTH
2024-07-05 20:38:14 +0200 <geekosaur> yes
2024-07-05 20:39:09 +0200euleritian(~euleritia@ip4d16fc38.dynamic.kabel-deutschland.de) (Ping timeout: 255 seconds)
2024-07-05 20:39:11 +0200 <haskellbridge> <iqubic (she/her)> What should I use for random numbers?
2024-07-05 20:39:25 +0200euleritian(~euleritia@dynamic-176-002-131-122.176.2.pool.telefonica.de)
2024-07-05 20:41:05 +0200 <hc> Depends on what you want to use them for
2024-07-05 20:42:55 +0200 <jle`> dmj`: omg this whole time
2024-07-05 20:44:54 +0200 <dmj`> ¯\_(ツ)_/¯
2024-07-05 20:45:12 +0200 <darkling> iqubic: 7 is a good number. Use that.
2024-07-05 20:46:37 +0200 <haskellbridge> <iqubic (she/her)> hc: I'm writing a program to simulate playing card games, and I want a way shuffle a "deck of cards" (it's just a list/vector of cards)
2024-07-05 20:47:22 +0200 <geekosaur> `random` is probably good enough for your use case
2024-07-05 20:47:53 +0200 <haskellbridge> <iqubic (she/her)> What is "random"?
2024-07-05 20:48:05 +0200 <geekosaur> @hackage random
2024-07-05 20:48:05 +0200 <lambdabot> https://hackage.haskell.org/package/random
2024-07-05 20:48:31 +0200 <Leary> Or MonadRandom.
2024-07-05 20:49:16 +0200 <haskellbridge> <iqubic (she/her)> MonadRandom seems like half a dozen different but related things.
2024-07-05 20:50:30 +0200waleee(~waleee@h-176-10-144-38.NA.cust.bahnhof.se)
2024-07-05 20:51:30 +0200rdcdr(~rdcdr@user/rdcdr) (Ping timeout: 268 seconds)
2024-07-05 20:53:41 +0200 <haskellbridge> <iqubic (she/her)> "RandomGenM", "StatefulGen", "MonadInterleve", and "MonadRandom" all exist, and I'm not sure what the differences are...
2024-07-05 21:02:39 +0200 <EvanR> the classic shuffle algorithm requires a source of random dice rolls, which MonadRandom simplifies
2024-07-05 21:03:28 +0200 <haskellbridge> <iqubic (she/her)> I was thinking of doing something like a Fisher-Yates shuffle, but I'm not sure which of those 4 options I should use.
2024-07-05 21:12:13 +0200target_i(~target_i@user/target-i/x-6023099)
2024-07-05 21:20:48 +0200 <dmj`> > let deck = [1..52] in do { nums <- replicateM 52 (randomRIO (1,100)); pure $ fmap fst $ sortBy (compare `on` snd) (zip deck nums) }
2024-07-05 21:20:49 +0200 <lambdabot> error:
2024-07-05 21:20:49 +0200 <lambdabot> • Ambiguous type variable ‘m0’ arising from a use of ‘show_M259786827563...
2024-07-05 21:20:49 +0200 <lambdabot> prevents the constraint ‘(Show (m0 [Integer]))’ from being solved.
2024-07-05 21:30:52 +0200euleritian(~euleritia@dynamic-176-002-131-122.176.2.pool.telefonica.de) (Read error: Connection reset by peer)
2024-07-05 21:31:11 +0200euleritian(~euleritia@77.22.252.56)
2024-07-05 21:37:33 +0200L29Ah(~L29Ah@wikipedia/L29Ah)
2024-07-05 21:38:29 +0200tromp(~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) (Quit: My iMac has gone to sleep. ZZZzzz…)
2024-07-05 21:42:18 +0200 <haskellbridge> <iqubic (she/her)> I see what you've done there, but you can't show me the results because it's in IO
2024-07-05 21:48:22 +0200 <dmj`> iqubic: try it in ghci
2024-07-05 21:48:36 +0200rdcdr(~rdcdr@user/rdcdr)
2024-07-05 21:58:08 +0200 <haskellbridge> <iqubic (she/her)> I think GHCI would have some defaulting stuff.
2024-07-05 21:58:20 +0200 <haskellbridge> <iqubic (she/her)> What does randomRIO do?
2024-07-05 21:58:25 +0200rdcdr_(~rdcdr@75-172-0-68.tukw.qwest.net)
2024-07-05 21:59:28 +0200rdcdr_(~rdcdr@75-172-0-68.tukw.qwest.net) (Client Quit)
2024-07-05 21:59:48 +0200rdcdr(~rdcdr@user/rdcdr) (Ping timeout: 260 seconds)
2024-07-05 22:00:20 +0200rdcdr(~rdcdr@user/rdcdr)
2024-07-05 22:04:53 +0200lxsameer(~lxsameer@Serene/lxsameer) (Ping timeout: 240 seconds)
2024-07-05 22:05:43 +0200 <tomsmeding> iqubic: https://hackage.haskell.org/package/random-1.2.1.2/docs/System-Random.html#v:randomRIO ;)
2024-07-05 22:10:32 +0200rdcdr(~rdcdr@user/rdcdr) (Read error: Connection reset by peer)
2024-07-05 22:12:55 +0200euleritian(~euleritia@77.22.252.56) (Read error: Connection reset by peer)
2024-07-05 22:13:20 +0200euleritian(~euleritia@ip4d16fc38.dynamic.kabel-deutschland.de)
2024-07-05 22:13:57 +0200bitdex(~bitdex@gateway/tor-sasl/bitdex)
2024-07-05 22:27:31 +0200 <dmj`> it gives you random stuff
2024-07-05 22:34:38 +0200euleritian(~euleritia@ip4d16fc38.dynamic.kabel-deutschland.de) (Read error: Connection reset by peer)
2024-07-05 22:34:51 +0200euleritian(~euleritia@ip4d16fc38.dynamic.kabel-deutschland.de)
2024-07-05 22:42:12 +0200 <haskellbridge> <iqubic (she/her)> Actually what I'm looking for is a way to get a random element from a list.
2024-07-05 22:43:47 +0200 <geekosaur> https://wiki.haskell.org/Random_shuffle
2024-07-05 22:43:52 +0200 <mauke> https://perldoc.perl.org/perlfaq5#How-do-I-select-a-random-line-from-a-file%3F
2024-07-05 22:46:27 +0200 <haskellbridge> <iqubic (she/her)> I'm not sure the perldocs are gonna help me.
2024-07-05 22:47:23 +0200 <mauke> well, the obvious answer is to generate a number in the range (0, length xs - 1) and index into the list
2024-07-05 22:47:43 +0200 <mauke> if you want to treat the list as a stream instead, the perldoc algo would apply
2024-07-05 22:49:53 +0200 <mauke> it stores line N of the file with probability 1/N
2024-07-05 22:50:26 +0200 <mauke> so the first line is always retained; the second line overwrites it with probability 1/2; the third line overwrites that with probability 1/3; and so on
2024-07-05 22:51:48 +0200 <mauke> in the end, each line has probability 1/number-of-lines to be the stored winner
2024-07-05 22:54:43 +0200pavonia(~user@user/siracusa)
2024-07-05 22:57:38 +0200tromp(~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl)
2024-07-05 22:58:27 +0200tabaqui(~root@91.74.190.107) (Ping timeout: 264 seconds)
2024-07-05 23:01:27 +0200kimiamania(~65804703@user/kimiamania) (Quit: PegeLinux)
2024-07-05 23:01:49 +0200kimiamania(~65804703@user/kimiamania)
2024-07-05 23:02:28 +0200td_(~td@i53870914.versanet.de) (Quit: waking up from the american dream ...)
2024-07-05 23:07:27 +0200euleritian(~euleritia@ip4d16fc38.dynamic.kabel-deutschland.de) (Ping timeout: 264 seconds)
2024-07-05 23:07:35 +0200codaraxis__(~codaraxis@user/codaraxis)
2024-07-05 23:09:12 +0200target_i(~target_i@user/target-i/x-6023099) (Quit: leaving)
2024-07-05 23:09:23 +0200td_(~td@i53870914.versanet.de)
2024-07-05 23:10:41 +0200rdcdr(~rdcdr@user/rdcdr)
2024-07-05 23:11:41 +0200codaraxis___(~codaraxis@user/codaraxis) (Ping timeout: 256 seconds)
2024-07-05 23:16:31 +0200tabaqui(~root@87.201.238.61)
2024-07-05 23:16:55 +0200euleritian(~euleritia@ip4d16fc38.dynamic.kabel-deutschland.de)
2024-07-05 23:22:31 +0200__monty__(~toonn@user/toonn) (Quit: leaving)
2024-07-05 23:26:19 +0200rdcdr_(~rdcdr@75-172-0-68.tukw.qwest.net)
2024-07-05 23:27:13 +0200rdcdr(~rdcdr@user/rdcdr) (Ping timeout: 268 seconds)
2024-07-05 23:28:45 +0200benjaminl(~benjaminl@user/benjaminl) (Ping timeout: 268 seconds)
2024-07-05 23:32:14 +0200 <EvanR> clever
2024-07-05 23:33:41 +0200noumenon(~noumenon@2a01:799:cd8:e700:aa7e:eaff:fede:ff94) (Quit: Leaving)
2024-07-05 23:37:45 +0200rdcdr_(~rdcdr@75-172-0-68.tukw.qwest.net) (Ping timeout: 256 seconds)
2024-07-05 23:39:59 +0200dysthesis(~dysthesis@user/dysthesis)
2024-07-05 23:40:03 +0200benjaminl(~benjaminl@user/benjaminl)
2024-07-05 23:50:59 +0200mud(~mud@user/kadoban) (Ping timeout: 264 seconds)
2024-07-05 23:53:52 +0200mud(~mud@user/kadoban)
2024-07-05 23:57:23 +0200michalz(~michalz@185.246.207.200) (Quit: ZNC 1.9.0 - https://znc.in)