2022/12/23

2022-12-23 00:01:45 +0100__monty__(~toonn@user/toonn) (Quit: leaving)
2022-12-23 00:02:14 +0100califax(~califax@user/califx) (Remote host closed the connection)
2022-12-23 00:02:24 +0100 <kjlid[m]> https://paste.tomsmeding.com/EvuLLcEC shouldn't these two functions be the same thing?
2022-12-23 00:02:49 +0100califax(~califax@user/califx)
2022-12-23 00:03:47 +0100 <kjlid[m]> createDb compiles, createDb2 doesn't
2022-12-23 00:04:12 +0100motherfsck(~motherfsc@user/motherfsck) (Ping timeout: 265 seconds)
2022-12-23 00:04:39 +0100motherfsck(~motherfsc@user/motherfsck)
2022-12-23 00:04:40 +0100 <geekosaur> I'd be wary of ($)
2022-12-23 00:05:38 +0100 <geekosaur> it's not goingf to read your mind, it's not going to hunt for a place which makes it have the right type, it's a right-associative operator with lowest precedence and in this case is probably not doing what you intend
2022-12-23 00:06:30 +0100 <dsal> There's a joke about mind on $ but not $ on mind
2022-12-23 00:08:16 +0100nek0(~nek0@2a01:4f8:222:2b41::12)
2022-12-23 00:11:55 +0100 <kjlid[m]> But even if I do `let foo = sequence =<< forM keys ...` I get an error
2022-12-23 00:13:48 +0100wootehfoot(~wootehfoo@user/wootehfoot) (Read error: Connection reset by peer)
2022-12-23 00:18:53 +0100 <Square> there are no nifty methods to update lists other than take/drop combos?
2022-12-23 00:19:14 +0100 <dsal> what?
2022-12-23 00:19:24 +0100 <EvanR> yeah, not really
2022-12-23 00:19:36 +0100 <dsal> I'm not entirely sure what you mean by "update" but there are countless ways to do things.
2022-12-23 00:19:43 +0100 <EvanR> you can write a recursive function to zip to where you want to do an update and do something
2022-12-23 00:19:55 +0100 <Square> i meant like : update :: Int -> a -> [a] -> [a], however unsafe that looks
2022-12-23 00:19:59 +0100 <EvanR> and package that as a lens, or just use lens
2022-12-23 00:20:18 +0100 <Square> ok, thanks
2022-12-23 00:20:40 +0100 <EvanR> e.g. update :: Int -> (a -> a) -> [a] -> [a]
2022-12-23 00:21:03 +0100 <EvanR> or throw a maybe in there
2022-12-23 00:21:18 +0100 <c_wraith> > [11..17] & ix 3 %~ negate
2022-12-23 00:21:19 +0100 <lambdabot> [11,12,13,-14,15,16,17]
2022-12-23 00:21:31 +0100 <Square> its just for AOC so i'm not looking for something beutiful =D
2022-12-23 00:21:51 +0100 <dsal> If you're looking to update a single thing in the middle of a list, you probably don't want a list.
2022-12-23 00:21:55 +0100fizbin(~fizbin@user/fizbin) (Ping timeout: 256 seconds)
2022-12-23 00:22:51 +0100 <Square> good idea, ill zip it and make a Map of it and then back
2022-12-23 00:22:55 +0100 <dsal> Data.Sequence or Data.Map or Data.Array
2022-12-23 00:23:27 +0100takuan(~takuan@178-116-218-225.access.telenet.be) (Remote host closed the connection)
2022-12-23 00:24:10 +0100 <Square> sequence looks promising too. Ill ttry that
2022-12-23 00:25:11 +0100MajorBiscuit(~MajorBisc@31-23-159.netrun.cytanet.com.cy) (Ping timeout: 260 seconds)
2022-12-23 00:25:19 +0100freeside(~mengwong@103.252.202.159) (Ping timeout: 256 seconds)
2022-12-23 00:25:36 +0100 <geekosaur> kjlid[m], you used <-, changing it to a let or a $ won't work, it needs a >>=
2022-12-23 00:26:01 +0100coot(~coot@2a02:a310:e241:1b00:ec1a:e9df:79ac:66ba) (Quit: coot)
2022-12-23 00:26:06 +0100 <geekosaur> `x <- expr` is `expr >>= \x ->`
2022-12-23 00:27:41 +0100use-value(~Thunderbi@2a00:23c6:8a03:2f01:75c2:a71f:beaa:29bf) (Remote host closed the connection)
2022-12-23 00:28:00 +0100use-value(~Thunderbi@2a00:23c6:8a03:2f01:75c2:a71f:beaa:29bf)
2022-12-23 00:32:54 +0100thegeekinside(~thegeekin@189.128.148.159) (Remote host closed the connection)
2022-12-23 00:33:13 +0100 <kjlid[m]> So I redid createDb2 a little: https://paste.tomsmeding.com/BgcrsKPT
2022-12-23 00:33:47 +0100 <dsal> I'd advise against `return` in general as it makes people think they need it. heh.
2022-12-23 00:34:04 +0100 <kjlid[m]> Why does sequence turn into `[Either HpassError Pubkey] -> IO [Pubkey]`?
2022-12-23 00:34:04 +0100 <dsal> `foo <- forM keys (insertKey conn) >>= sequence; return foo` is the same thing as `forM keys (insertKey conn) >>= sequence`
2022-12-23 00:35:55 +0100 <dsal> :t sequence
2022-12-23 00:35:56 +0100 <lambdabot> (Traversable t, Monad m) => t (m a) -> m (t a)
2022-12-23 00:36:18 +0100 <EvanR> dsal, Square, ime if you start with a list, convert to a Map, do something, and convert back many times then no, it's better to use a list updater
2022-12-23 00:36:34 +0100 <EvanR> especially if the number of things in the list is medium to small
2022-12-23 00:36:55 +0100 <EvanR> or you probabilistically operate near the beginning usually
2022-12-23 00:37:16 +0100 <dsal> kjlid[m]: It looks like you mean `sequence <$> traverse (insertKey conn) keys`
2022-12-23 00:37:18 +0100 <EvanR> if you can stay as a Map all the time that's another story
2022-12-23 00:37:54 +0100freeside(~mengwong@103.252.202.159)
2022-12-23 00:37:57 +0100mvk(~mvk@2607:fea8:5ce3:8500::6126)
2022-12-23 00:38:18 +0100mvk(~mvk@2607:fea8:5ce3:8500::6126) (Client Quit)
2022-12-23 00:39:44 +0100 <Square> sure, but this isn't important work. =D
2022-12-23 00:42:08 +0100 <dsal> Well, yeah, you don't want to convert in and out, but you should be able to do all the work in Sequence.
2022-12-23 00:42:26 +0100motherfsck(~motherfsc@user/motherfsck) (Ping timeout: 272 seconds)
2022-12-23 00:44:20 +0100 <kjlid[m]> dsal: I think that's literally the only combination I didn't try for some reason
2022-12-23 00:50:59 +0100talismanick(~talismani@76.133.152.122)
2022-12-23 00:51:29 +0100 <EvanR> Seq has better asymptotics but there is some overhead making a list better (and arguably simpler) when N is expected to be low
2022-12-23 00:51:41 +0100 <EvanR> below whatever breakeven
2022-12-23 00:57:28 +0100 <EvanR> though Seq comes with an actual API which is nice
2022-12-23 00:57:48 +0100zeenk(~zeenk@82.79.126.109) (Quit: Konversation terminated!)
2022-12-23 00:59:17 +0100cheater(~Username@user/cheater)
2022-12-23 00:59:21 +0100 <dsal> Note that a lot of the API is in Data.Foldable
2022-12-23 01:01:37 +0100ChaiTRex(~ChaiTRex@user/chaitrex) (Remote host closed the connection)
2022-12-23 01:02:38 +0100ChaiTRex(~ChaiTRex@user/chaitrex)
2022-12-23 01:03:21 +0100thegeekinside(~thegeekin@189.128.148.159)
2022-12-23 01:07:14 +0100v0id_ptr(~adrift@user/ptr-frac7al/x-0038398)
2022-12-23 01:09:24 +0100jinsun(~jinsun@user/jinsun) (Ping timeout: 255 seconds)
2022-12-23 01:10:11 +0100Midjak(~Midjak@82.66.147.146) (Quit: This computer has gone to sleep)
2022-12-23 01:17:02 +0100Tuplanolla(~Tuplanoll@91-159-68-152.elisa-laajakaista.fi) (Quit: Leaving.)
2022-12-23 01:25:32 +0100eggplantade(~Eggplanta@2600:1700:38c5:d800:1dcc:166b:1177:c3e0)
2022-12-23 01:30:05 +0100eggplantade(~Eggplanta@2600:1700:38c5:d800:1dcc:166b:1177:c3e0) (Ping timeout: 255 seconds)
2022-12-23 01:48:16 +0100wroathe(~wroathe@207-153-38-140.fttp.usinternet.com)
2022-12-23 01:48:16 +0100wroathe(~wroathe@207-153-38-140.fttp.usinternet.com) (Changing host)
2022-12-23 01:48:16 +0100wroathe(~wroathe@user/wroathe)
2022-12-23 01:49:06 +0100fizbin(~fizbin@user/fizbin)
2022-12-23 01:54:33 +0100gurkenglas(~gurkengla@p548ac72e.dip0.t-ipconnect.de)
2022-12-23 02:00:05 +0100[itchyjunk](~itchyjunk@user/itchyjunk/x-7353470)
2022-12-23 02:05:00 +0100slack1256(~slack1256@186.11.29.60)
2022-12-23 02:05:11 +0100thongpv87(~thongpv87@2402:9d80:3c4:ae3b:4b13:46b3:cad7:5da8)
2022-12-23 02:09:34 +0100jargon(~jargon@174-22-192-24.phnx.qwest.net) (Remote host closed the connection)
2022-12-23 02:10:48 +0100albet70(~xxx@2400:8902::f03c:92ff:fe60:98d8) (Remote host closed the connection)
2022-12-23 02:12:18 +0100elevenkb(~elevenkb@105.224.37.128) (Ping timeout: 260 seconds)
2022-12-23 02:16:29 +0100wroathe(~wroathe@user/wroathe) (Ping timeout: 252 seconds)
2022-12-23 02:16:55 +0100albet70(~xxx@2400:8902::f03c:92ff:fe60:98d8)
2022-12-23 02:17:29 +0100gurkenglas(~gurkengla@p548ac72e.dip0.t-ipconnect.de) (Ping timeout: 268 seconds)
2022-12-23 02:18:29 +0100bilegeek(~bilegeek@2600:1008:b057:74f5:d377:f773:aec0:435a)
2022-12-23 02:22:50 +0100bitdex(~bitdex@gateway/tor-sasl/bitdex) (Ping timeout: 255 seconds)
2022-12-23 02:26:41 +0100bitdex(~bitdex@gateway/tor-sasl/bitdex)
2022-12-23 02:35:33 +0100bilegeek(~bilegeek@2600:1008:b057:74f5:d377:f773:aec0:435a) (Quit: Leaving)
2022-12-23 02:35:34 +0100finsternis(~X@23.226.237.192) (Read error: Connection reset by peer)
2022-12-23 02:37:53 +0100xff0x(~xff0x@ai071162.d.east.v6connect.net) (Ping timeout: 246 seconds)
2022-12-23 02:47:20 +0100freeside(~mengwong@103.252.202.159) (Ping timeout: 246 seconds)
2022-12-23 02:52:43 +0100thongpv87(~thongpv87@2402:9d80:3c4:ae3b:4b13:46b3:cad7:5da8) (Ping timeout: 248 seconds)
2022-12-23 02:56:34 +0100thongpv87(~thongpv87@123.31.184.254)
2022-12-23 02:57:01 +0100ddellacosta(~ddellacos@89.45.224.51)
2022-12-23 02:58:38 +0100freeside(~mengwong@103.252.202.159)
2022-12-23 03:06:00 +0100 <ddellacosta> how do I decode a sum type from Dhall into Haskell, like `data Foo = A | B | C`? I don't know if I should be using `constructor` with some kind of decoder argument but it's not obvious what that would be https://hackage.haskell.org/package/dhall-1.31.1/docs/Dhall.html#t:UnionDecoder
2022-12-23 03:22:39 +0100xff0x(~xff0x@125x103x176x34.ap125.ftth.ucom.ne.jp)
2022-12-23 03:26:09 +0100fizbin(~fizbin@user/fizbin) (Ping timeout: 252 seconds)
2022-12-23 03:27:06 +0100troydm(~troydm@host-176-37-124-197.b025.la.net.ua) (Ping timeout: 272 seconds)
2022-12-23 03:27:09 +0100eggplantade(~Eggplanta@2600:1700:38c5:d800:1dcc:166b:1177:c3e0)
2022-12-23 03:30:36 +0100motherfsck(~motherfsc@user/motherfsck)
2022-12-23 03:31:39 +0100eggplantade(~Eggplanta@2600:1700:38c5:d800:1dcc:166b:1177:c3e0) (Ping timeout: 252 seconds)
2022-12-23 03:32:58 +0100travv0(sid293381@user/travv0)
2022-12-23 03:38:38 +0100razetime(~quassel@49.207.230.181)
2022-12-23 03:40:56 +0100cheater(~Username@user/cheater) (Quit: Going offline, see ya! (www.adiirc.com))
2022-12-23 03:41:32 +0100cheater(~Username@user/cheater)
2022-12-23 03:52:11 +0100motherfsck(~motherfsc@user/motherfsck) (Ping timeout: 252 seconds)
2022-12-23 04:05:54 +0100morb(~morb@pool-72-80-94-112.nycmny.fios.verizon.net)
2022-12-23 04:13:02 +0100Kaiepi(~Kaiepi@108.175.84.104) (Ping timeout: 246 seconds)
2022-12-23 04:17:23 +0100thongpv(~thongpv87@2001:ee0:54a8:aee0:7c8f:cdb6:1db0:5cd9)
2022-12-23 04:18:14 +0100Inst(~Inst@2601:6c4:4081:54f0:5c02:2b13:b462:4536) (Read error: Connection reset by peer)
2022-12-23 04:19:22 +0100eggplantade(~Eggplanta@2600:1700:38c5:d800:1dcc:166b:1177:c3e0)
2022-12-23 04:19:40 +0100thongpv87(~thongpv87@123.31.184.254) (Ping timeout: 272 seconds)
2022-12-23 04:27:36 +0100td_(~td@83.135.9.52) (Ping timeout: 268 seconds)
2022-12-23 04:28:49 +0100td_(~td@83.135.9.52)
2022-12-23 04:38:42 +0100bjourne(~bjorn@94.191.153.229) (Read error: Connection reset by peer)
2022-12-23 04:44:56 +0100terrorjack(~terrorjac@2a01:4f8:1c1e:509a::1) (Ping timeout: 246 seconds)
2022-12-23 04:50:20 +0100terrorjack(~terrorjac@2a01:4f8:1c1e:509a::1)
2022-12-23 04:52:26 +0100 <sm> would anyone have an example of using megaparsec's dbg ? I cannot figure it out
2022-12-23 04:54:31 +0100 <sm> seems simplel enough >:(
2022-12-23 04:56:00 +0100 <sm> oh well, moving on
2022-12-23 05:03:22 +0100freeside(~mengwong@103.252.202.159) (Ping timeout: 268 seconds)
2022-12-23 05:04:12 +0100 <sm> I get the impression dbg in megaparsec 9.2.2 works only for ParsecT parsers. Mine have StateT on top of that. And dbg in megaparsec 9.3 might be more flexible.
2022-12-23 05:09:04 +0100ddellacosta(~ddellacos@89.45.224.51) (Ping timeout: 272 seconds)
2022-12-23 05:09:10 +0100 <sm> how does any of this code work when I understand so little..
2022-12-23 05:09:30 +0100mbuf(~Shakthi@49.204.130.4)
2022-12-23 05:12:23 +0100 <sm> yes! dbg from megaparsec 9.3 just worked. \o/
2022-12-23 05:15:27 +0100machinedgod(~machinedg@d198-53-218-113.abhsia.telus.net) (Ping timeout: 260 seconds)
2022-12-23 05:16:18 +0100 <iqubic> What is dbg?
2022-12-23 05:16:53 +0100 <iqubic> Oh, it's like traceShowId, but for Megaparec Parsers
2022-12-23 05:17:01 +0100 <iqubic> :t traceShowId
2022-12-23 05:17:02 +0100 <lambdabot> error: Variable not in scope: traceShowId
2022-12-23 05:17:20 +0100freeside(~mengwong@103.252.202.159)
2022-12-23 05:17:42 +0100 <iqubic> Wait... actually it's just trace
2022-12-23 05:17:46 +0100 <iqubic> :t trace
2022-12-23 05:17:47 +0100 <lambdabot> error: Variable not in scope: trace
2022-12-23 05:18:02 +0100morb(~morb@pool-72-80-94-112.nycmny.fios.verizon.net) (Remote host closed the connection)
2022-12-23 05:18:02 +0100 <iqubic> @import Debug.Trace
2022-12-23 05:18:02 +0100 <lambdabot> Unknown command, try @list
2022-12-23 05:18:20 +0100 <sm> it gives output like this. Better than the home-grown one I used to use. Great!... (full message at <https://libera.ems.host/_matrix/media/v3/download/libera.chat/2a034e4c39f94bb40df5277422581bddd5d2…>)
2022-12-23 05:18:40 +0100 <iqubic> sm: I think dbg is sorta like trace from Debug.Trace: https://hackage.haskell.org/package/base-4.17.0.0/docs/Debug-Trace.html#v:trace
2022-12-23 05:19:12 +0100 <iqubic> Oh, that's even better
2022-12-23 05:19:16 +0100 <sm> it uses trace, but shows useful parser-related info without having to figure that out yourself. A must have for debugging parsers
2022-12-23 05:19:28 +0100wroathe(~wroathe@207-153-38-140.fttp.usinternet.com)
2022-12-23 05:19:28 +0100wroathe(~wroathe@207-153-38-140.fttp.usinternet.com) (Changing host)
2022-12-23 05:19:28 +0100wroathe(~wroathe@user/wroathe)
2022-12-23 05:20:32 +0100 <iqubic> I've not seen a need to use it myself.
2022-12-23 05:21:18 +0100 <iqubic> I tend to just use errorBundlePretty to get Megaparsec errors printed in a nice way.
2022-12-23 05:22:19 +0100 <iqubic> https://hackage.haskell.org/package/megaparsec-9.3.0/docs/Text-Megaparsec.html#v:runParser
2022-12-23 05:23:11 +0100 <iqubic> That gives me either an complex error type, or something of type a. I then use errorBundlePretty to pretty print the error message.
2022-12-23 05:24:13 +0100 <sm> sometimes you need to see intermediate state, not just the final error
2022-12-23 05:28:22 +0100 <iqubic> I've never needed to see the intermediate state. But I can imagine with more complicated parsers that can be useful.
2022-12-23 05:32:21 +0100beefbambi(~beefbambi@183.82.204.74) (Ping timeout: 268 seconds)
2022-12-23 05:32:36 +0100Sciencentistguy5(~sciencent@hacksoc/ordinary-member)
2022-12-23 05:34:13 +0100Unicorn_Princess(~Unicorn_P@user/Unicorn-Princess/x-3540542) (Remote host closed the connection)
2022-12-23 05:34:29 +0100Sciencentistguy(~sciencent@hacksoc/ordinary-member) (Ping timeout: 260 seconds)
2022-12-23 05:34:29 +0100Sciencentistguy5Sciencentistguy
2022-12-23 05:35:19 +0100ezzieyguywuf(~Unknown@user/ezzieyguywuf) (Remote host closed the connection)
2022-12-23 05:37:10 +0100beefbambi(~beefbambi@2401:4900:230d:f57c:538c:d7cc:50c0:e377)
2022-12-23 05:44:56 +0100ezzieyguywuf(~Unknown@user/ezzieyguywuf)
2022-12-23 05:47:34 +0100quazimodo(~quazimodo@122-199-39-221.ip4.superloop.com)
2022-12-23 05:56:01 +0100 <sm> yeah it just saved me here where I couldn't figure out what was happening. dbg + emacs coloured highlighting of key parts ftw
2022-12-23 05:57:19 +0100smuploaded an image: (96KiB) < https://libera.ems.host/_matrix/media/v3/download/matrix.org/SDBAoBibDYbYCoyZnyVfjvXp/Screen%20Sho… >
2022-12-23 05:58:00 +0100 <sm> that second last MATCH was consuming a ( needed by the next parser, until I added a try
2022-12-23 06:03:15 +0100use-value(~Thunderbi@2a00:23c6:8a03:2f01:75c2:a71f:beaa:29bf) (Quit: use-value)
2022-12-23 06:11:42 +0100L29Ah(~L29Ah@wikipedia/L29Ah)
2022-12-23 06:17:35 +0100thegeekinside(~thegeekin@189.128.148.159) (Ping timeout: 264 seconds)
2022-12-23 06:24:58 +0100[itchyjunk](~itchyjunk@user/itchyjunk/x-7353470) (Remote host closed the connection)
2022-12-23 06:25:10 +0100mbuf(~Shakthi@49.204.130.4) (Remote host closed the connection)
2022-12-23 06:25:36 +0100mbuf(~Shakthi@49.204.130.4)
2022-12-23 06:33:09 +0100Kaiepi(~Kaiepi@108.175.84.104)
2022-12-23 06:57:44 +0100poscat(~poscat@2408:8206:4823:14c6:2d43:62ac:d2b8:b823) (Quit: Bye)
2022-12-23 06:58:03 +0100poscat(~poscat@114.245.108.192)
2022-12-23 07:05:09 +0100L29Ah(~L29Ah@wikipedia/L29Ah) ()
2022-12-23 07:13:44 +0100trev(~trev@user/trev)
2022-12-23 07:27:08 +0100freeside(~mengwong@103.252.202.159) (Ping timeout: 272 seconds)
2022-12-23 07:32:41 +0100johnw(~johnw@2600:1700:cf00:db0:3017:1dda:5aaf:2264) (Quit: ZNC - http://znc.in)
2022-12-23 07:33:27 +0100takuan(~takuan@178-116-218-225.access.telenet.be)
2022-12-23 07:33:35 +0100 <iqubic> @pl \f -> f x y
2022-12-23 07:33:35 +0100 <lambdabot> flip ($ x) y
2022-12-23 07:33:39 +0100 <iqubic> Eww...
2022-12-23 07:37:04 +0100 <c_wraith> that makes sense. And I'd never use it
2022-12-23 07:41:03 +0100freeside(~mengwong@103.252.202.159)
2022-12-23 07:42:34 +0100shriekingnoise(~shrieking@186.137.167.202) (Quit: Quit)
2022-12-23 07:45:42 +0100 <int-e> ($ y) . ($ x) would be more systematic
2022-12-23 07:47:27 +0100 <int-e> But I'd use (\f -> f x y) too
2022-12-23 07:48:20 +0100freeside(~mengwong@103.252.202.159) (Ping timeout: 246 seconds)
2022-12-23 07:51:06 +0100jinsun(~jinsun@user/jinsun)
2022-12-23 07:59:25 +0100cheater_(~Username@user/cheater)
2022-12-23 08:01:29 +0100cheater__(~Username@user/cheater)
2022-12-23 08:01:35 +0100cheater(~Username@user/cheater) (Ping timeout: 268 seconds)
2022-12-23 08:01:44 +0100cheater__cheater
2022-12-23 08:03:28 +0100ezzieyguywuf(~Unknown@user/ezzieyguywuf) (Read error: Connection reset by peer)
2022-12-23 08:03:44 +0100ezzieyguywuf(~Unknown@user/ezzieyguywuf)
2022-12-23 08:05:08 +0100cheater_(~Username@user/cheater) (Ping timeout: 272 seconds)
2022-12-23 08:07:39 +0100 <iqubic> int-e: The code I just wrote contains a line of the form "map (\f -> f x y) xs"
2022-12-23 08:08:55 +0100 <int-e> iqubic: mine has `... >>= \f -> f x y`
2022-12-23 08:09:18 +0100Inst(~Inst@2601:6c4:4081:54f0:c13a:1faa:a088:6fcb)
2022-12-23 08:09:23 +0100 <iqubic> Isn't that essentially the same thing?
2022-12-23 08:09:23 +0100 <Inst> do I understand hylomorphisms?
2022-12-23 08:09:27 +0100 <Inst> oh, sorry, i'll wait
2022-12-23 08:09:45 +0100 <iqubic> Inst: Please ask your questions now. No need to wait.
2022-12-23 08:09:51 +0100 <int-e> iqubic: yes, that's the point. (but >>= instead of map is a tiny difference)
2022-12-23 08:10:16 +0100 <iqubic> Yeah, (>>=) = concatMap for lists.
2022-12-23 08:10:23 +0100 <Inst> I'm addicted to accumulating parameters, not sure if others are aware of that
2022-12-23 08:10:44 +0100 <int-e> iqubic: The real point was, I think I know what your code is for, given the timing, mainly.
2022-12-23 08:11:01 +0100 <Inst> shouldn't it be flip (>>=) => concatMap?
2022-12-23 08:11:02 +0100 <iqubic> My code is for Advent of Code, yes.
2022-12-23 08:11:18 +0100 <int-e> Inst: yep
2022-12-23 08:11:31 +0100 <Inst> but, i'm abotu to benchmark it properly via criterion
2022-12-23 08:11:42 +0100 <int-e> I actually had to go back and check that I didn't use a list comprehension :-P
2022-12-23 08:11:46 +0100 <Inst> it seems that hylomorphisms are faster than accumulating parameters?
2022-12-23 08:12:03 +0100 <iqubic> int-e: What you might not know is that I actually have a value of type [Set (Int, Int) -> (Int, Int) -> Maybe Int]
2022-12-23 08:12:24 +0100 <iqubic> And no, it's not the trivial empty listt.
2022-12-23 08:12:35 +0100 <c_wraith> Inst: they're just not even the same thing. If you're using both to solve a problem, you're using different algorithms. That's the difference you're measuring.
2022-12-23 08:12:50 +0100 <Inst> are they not?
2022-12-23 08:12:56 +0100 <Inst> https://reasonablypolymorphic.com/blog/recursion-schemes/
2022-12-23 08:13:25 +0100 <Inst> i rewrote using foldl', got a 150% speed-up on GHCI
2022-12-23 08:13:38 +0100 <c_wraith> well, don't benchmark anything in ghci
2022-12-23 08:14:16 +0100 <iqubic> Yeah. Compiling the code allows you to get better benchmark results.
2022-12-23 08:16:16 +0100 <Inst> my hylo is about 1% faster than my accumulating parameter version in GHCI, but then again, this is crap, because I'm fixing to int
2022-12-23 08:17:19 +0100 <iqubic> It's also a test being done in GHCI, which will inherently give worse results
2022-12-23 08:17:31 +0100freeside(~mengwong@103.252.202.159)
2022-12-23 08:18:04 +0100 <Inst> erm, not GHCI, criterion
2022-12-23 08:18:11 +0100 <Inst> criterion finally compiled
2022-12-23 08:19:09 +0100 <Inst> huh, forget it
2022-12-23 08:19:23 +0100 <Inst> when i swap out to integer, the fastest factorial i have is the iterate version
2022-12-23 08:19:58 +0100 <Inst> i'm just looking for a general purpose replacement for accumulating parameter code i use; I know when foldl' / foldr can be used for other simple recursions
2022-12-23 08:22:08 +0100freeside(~mengwong@103.252.202.159) (Ping timeout: 260 seconds)
2022-12-23 08:22:33 +0100wroathe(~wroathe@user/wroathe) (Ping timeout: 268 seconds)
2022-12-23 08:25:45 +0100 <Inst> about 15% faster, but iterate wins out if i change types from int to integer, i wonder why
2022-12-23 08:26:56 +0100freeside(~mengwong@103.252.202.159)
2022-12-23 08:28:54 +0100 <int-e> iqubic: same here :)
2022-12-23 08:29:48 +0100 <int-e> iqubic: actually, no. the arguments are the same; the result is [(Int,Int)]
2022-12-23 08:31:10 +0100 <iqubic> Also, technically it's a V2 Int, instead of an (Int, Int), but it's mostly the same here.
2022-12-23 08:31:28 +0100 <iqubic> https://hackage.haskell.org/package/linear-1.22/docs/Linear-V2.html
2022-12-23 08:32:06 +0100 <iqubic> V2 has some helpful numerical instances like (Num a) => Num (V2 a) which do pairwise operations
2022-12-23 08:32:52 +0100 <int-e> Makes sense.
2022-12-23 08:34:43 +0100tromp(~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl)
2022-12-23 08:40:16 +0100 <Inst> c_wraith: why aren't they the same thing? shouldn't unfoldr / foldl' result in code that's equivalent to a for loop via list fusion?
2022-12-23 08:40:33 +0100 <Inst> and shouldn't accumulating parameter, via TCO, result in a for loop as well?
2022-12-23 08:41:25 +0100Sgeo(~Sgeo@user/sgeo) (Read error: Connection reset by peer)
2022-12-23 08:42:28 +0100Invariance(~Invarianc@ppp1093.dsl.ontario.net)
2022-12-23 08:45:31 +0100Invariance(~Invarianc@ppp1093.dsl.ontario.net) (Client Quit)
2022-12-23 08:58:20 +0100MajorBiscuit(~MajorBisc@31-23-159.netrun.cytanet.com.cy)
2022-12-23 09:00:18 +0100 <int-e> Inst: ghci essentially doesn't optimize... there's no fusion (since that's usually based on rewrite rules and heavy inlining). TCO should still work most of the time.
2022-12-23 09:00:28 +0100 <Inst> i'm doing it via criterion now
2022-12-23 09:00:47 +0100 <Inst> and i'm pissed, because i feel like, i must have screwed up somewhere, but the iterate solution is massively beating everything else
2022-12-23 09:01:23 +0100 <Inst> ugh, sigh
2022-12-23 09:01:47 +0100 <Inst> i want to quit my accumulating parameter habit, iterate is almost worse, because iterate uses a partial function to make it work
2022-12-23 09:02:48 +0100 <Inst> my goto when i don't know how to solve anything is to get an accumulating parameter, which is basically just getting a for loop, and this is in haskell
2022-12-23 09:03:01 +0100 <int-e> Well iterate is usually quite good, thanks to build/foldr fusion.
2022-12-23 09:03:26 +0100 <Inst> iterate is technically a hylomorphism, isn't it?
2022-12-23 09:04:11 +0100 <Inst> it's a very specific fold; i think, but tbh it should be possible to implement (!!) via foldr, no?
2022-12-23 09:05:01 +0100 <int-e> It's a specific unfold, so an anamorphism. You need a subsequent fold (catamorphism) to make a hylomorphism.
2022-12-23 09:05:13 +0100 <Inst> and (!!) counts?
2022-12-23 09:06:03 +0100 <Inst> i guess when i say iterate, i mean the (iterate (nextIteration) seed !!) pattern
2022-12-23 09:06:56 +0100 <int-e> > foldr (\x f n -> if n == 0 then x else f (n-1)) undefined "abcdef" 3
2022-12-23 09:06:58 +0100 <lambdabot> 'd'
2022-12-23 09:07:29 +0100thongpv87(~thongpv87@2402:9d80:3c4:ae3b:5372:83e0:6f97:a164)
2022-12-23 09:08:08 +0100 <int-e> Oh that's essentially the implementation in GHC.List.
2022-12-23 09:09:34 +0100quazimodo(~quazimodo@122-199-39-221.ip4.superloop.com) (Remote host closed the connection)
2022-12-23 09:09:36 +0100 <int-e> So anyway, yes, it's a `foldr`.
2022-12-23 09:10:19 +0100thongpv(~thongpv87@2001:ee0:54a8:aee0:7c8f:cdb6:1db0:5cd9) (Ping timeout: 248 seconds)
2022-12-23 09:10:28 +0100 <Inst> at least i have the fig leaf of a recursion scheme over iterate
2022-12-23 09:11:05 +0100 <int-e> So build/foldr fusion will turn `iterate f x !! g` into code that uses an accumulator; no point in doing that manually.
2022-12-23 09:11:53 +0100eggplantade(~Eggplanta@2600:1700:38c5:d800:1dcc:166b:1177:c3e0) (Remote host closed the connection)
2022-12-23 09:12:41 +0100 <Inst> i think, when i'm benchmarking under criterion, if i let float my accum parameter, it's still the fastest of all my facs
2022-12-23 09:12:44 +0100 <Inst> i can send you the pastebin
2022-12-23 09:13:23 +0100 <Inst> https://pastebin.com/UKHpt5Y0
2022-12-23 09:14:41 +0100 <Inst> when it's all int, accumulating parameter benches best, without the let float, hylomorphism benches better, when it's in integer, only thing that's actually fast is the iterate version
2022-12-23 09:17:01 +0100 <int-e> try this silly thing... http://paste.debian.net/1265028/
2022-12-23 09:17:37 +0100 <int-e> Unless your arguments are tiny, with Integer you're spending most of the time multiplying numbers.
2022-12-23 09:17:42 +0100 <int-e> arg, I messed up
2022-12-23 09:18:05 +0100 <int-e> http://paste.debian.net/1265029/ is what I wanted
2022-12-23 09:18:38 +0100 <int-e> (this is still not the best way to compute large factorials... for that, you should count prime factors)
2022-12-23 09:19:45 +0100 <Inst> tbh, it's just benchmarking to get an idea of how algorithms and approaches behave in Haskell
2022-12-23 09:19:57 +0100 <int-e> Inst: and on the non-silly front, have you tried product [1..n] ?
2022-12-23 09:19:59 +0100 <Inst> i probably should go into some willy nilly phase wherein i want to foldl' or foldr everything
2022-12-23 09:21:18 +0100 <Inst> benchmarking that now
2022-12-23 09:22:05 +0100Tuplanolla(~Tuplanoll@91-159-68-152.elisa-laajakaista.fi)
2022-12-23 09:22:32 +0100 <int-e> anyway, I wouldn't be able to say without benchmarking whether fac, fac''', or fac'''' are significantly different; they all have a chance to produce essentially the same accumulating code. Though fac''' may end up maintaining two counters so that may suffer.
2022-12-23 09:23:12 +0100 <int-e> fac' and fac'' should be inferior.
2022-12-23 09:23:26 +0100 <int-e> (and about equal to each other)
2022-12-23 09:24:15 +0100 <Inst> this for me, at least, is the consummate weirdness
2022-12-23 09:24:21 +0100 <int-e> (because after inlining `fix` and desugaring the case analysis of `fac'`, they're really the same thing)
2022-12-23 09:24:23 +0100 <Inst> https://media.discordapp.net/attachments/968989726633779215/1055762707296559135/image.png
2022-12-23 09:25:04 +0100 <Inst> ,bgroup "someCrap" [bench "iterate" $ nf fac''' 100_000]
2022-12-23 09:27:23 +0100johnw(~johnw@76-234-69-149.lightspeed.frokca.sbcglobal.net)
2022-12-23 09:28:27 +0100cheater_(~Username@user/cheater)
2022-12-23 09:28:28 +0100 <int-e> Is that for Integer? I think it's more meaningful to do all this with `Int` rather than with code that deals with 100ks of digits.
2022-12-23 09:30:10 +0100 <int-e> (There'll be *a lot* of garbage and it's quite conceivable that different versions of the code spend different proportions of their time in the garbage collector.)
2022-12-23 09:30:43 +0100cheater(~Username@user/cheater) (Ping timeout: 260 seconds)
2022-12-23 09:30:52 +0100cheater_cheater
2022-12-23 09:33:52 +0100Xeroine(~Xeroine@user/xeroine) (Quit: ZNC 1.8.2+deb2+b1 - https://znc.in)
2022-12-23 09:34:54 +0100Xeroine(~Xeroine@user/xeroine)
2022-12-23 09:35:55 +0100thongpv87(~thongpv87@2402:9d80:3c4:ae3b:5372:83e0:6f97:a164) (Ping timeout: 248 seconds)
2022-12-23 09:38:16 +0100Midjak(~Midjak@82.66.147.146)
2022-12-23 09:43:32 +0100 <Inst> yeah, that's for integer
2022-12-23 09:44:39 +0100 <Inst> with int, you have the problem that you start getting overflows too quickly, though
2022-12-23 09:44:48 +0100 <Inst> only 30 iirc, gets you an overflow
2022-12-23 09:44:50 +0100thongpv87(~thongpv87@2402:9d80:346:901d:874b:931b:303e:63a1)
2022-12-23 09:44:54 +0100 <int-e> Doesn't matter; the compiler doesn't know.
2022-12-23 09:45:23 +0100 <int-e> You could compute triangular numbers instead.
2022-12-23 09:45:42 +0100 <int-e> > product [1..128] :: Int
2022-12-23 09:45:43 +0100 <lambdabot> 0
2022-12-23 09:46:37 +0100 <Inst> 20 is the max you get before you start overflowing
2022-12-23 09:47:00 +0100 <int-e> you still get meaningful performance measurements though
2022-12-23 09:47:10 +0100 <Inst> ummm, n^2 - 1?
2022-12-23 09:47:21 +0100 <Inst> wait, that's not the pattern
2022-12-23 09:47:27 +0100 <Inst> (n-1)^2 + 1
2022-12-23 09:47:41 +0100 <Inst> welp, still wrong
2022-12-23 09:47:49 +0100 <int-e> If you actually want to compute factorials for n > 200, none of those implementations is
2022-12-23 09:47:57 +0100 <Inst> (n^2 + n) / 2
2022-12-23 09:47:58 +0100 <int-e> > sum [1..100]
2022-12-23 09:47:59 +0100 <lambdabot> 5050
2022-12-23 09:48:11 +0100 <int-e> > product [1..100]
2022-12-23 09:48:12 +0100 <lambdabot> 9332621544394415268169923885626670049071596826438162146859296389521759999322...
2022-12-23 09:48:20 +0100 <Jadesheit[m]> > zip [1..] [product [1..n] :: Int | n <- [1..100]]
2022-12-23 09:48:21 +0100 <lambdabot> [(1,1),(2,2),(3,6),(4,24),(5,120),(6,720),(7,5040),(8,40320),(9,362880),(10,...
2022-12-23 09:48:27 +0100 <int-e> it's the same recursive pattern with addition instead of multiplication
2022-12-23 09:48:57 +0100 <int-e> > scanl (*) 1 [1..] !! 10
2022-12-23 09:48:59 +0100 <lambdabot> 3628800
2022-12-23 09:49:09 +0100thongpv87(~thongpv87@2402:9d80:346:901d:874b:931b:303e:63a1) (Ping timeout: 256 seconds)
2022-12-23 09:51:18 +0100 <Jadesheit[m]> > filter (== 0) $ zip [1..] (scanl (*) 1 [1..100])
2022-12-23 09:51:20 +0100 <lambdabot> error:
2022-12-23 09:51:20 +0100 <lambdabot> • No instance for (Num (Integer, Integer))
2022-12-23 09:51:20 +0100 <lambdabot> arising from a use of ‘e_10111100’
2022-12-23 09:51:42 +0100 <int-e> Inst: http://paste.debian.net/1265029/ is a decent (but not great) implementation of factorials for integers... it'll be much faster for 100,000! than what you have.
2022-12-23 09:51:50 +0100 <Jadesheit[m]> * 1 [1..100] :: [Int])
2022-12-23 09:51:56 +0100 <int-e> (same paste as earlier)
2022-12-23 09:53:12 +0100thongpv87(~thongpv87@2402:9d80:346:901d:126:7968:86ee:f4cf)
2022-12-23 09:54:47 +0100 <Inst> testing now
2022-12-23 09:56:30 +0100machinedgod(~machinedg@d198-53-218-113.abhsia.telus.net)
2022-12-23 09:57:05 +0100 <Inst> see, i get the feeling the iterate is broken
2022-12-23 09:57:21 +0100 <Inst> it's still faster than your version, which, admittedly, is MUUUCH faster than all the other versions
2022-12-23 09:57:38 +0100 <Inst> 45.66 ms vs 1 second vs 1 ms
2022-12-23 09:57:52 +0100freeside(~mengwong@103.252.202.159) (Ping timeout: 272 seconds)
2022-12-23 09:59:20 +0100 <Jadesheit[m]> Where's the git repo for lambdabot:
2022-12-23 10:00:03 +0100Player-205[m](~sashaserp@2001:470:69fc:105::2:30b8) (Quit: You have been kicked for being idle)
2022-12-23 10:00:04 +0100AdamConner-Sax[m(~adamcsmat@2001:470:69fc:105::1:e2c8) (Quit: You have been kicked for being idle)
2022-12-23 10:00:08 +0100yl53[m](~yl53matri@2001:470:69fc:105::85b) (Quit: You have been kicked for being idle)
2022-12-23 10:00:36 +0100freeside(~mengwong@103.252.202.159)
2022-12-23 10:00:52 +0100 <mauke> @where lambdabot
2022-12-23 10:00:52 +0100 <lambdabot> http://haskell.org/haskellwiki/Lambdabot
2022-12-23 10:01:21 +0100vpan(~0@212.117.1.172)
2022-12-23 10:02:28 +0100 <mauke> @where+ lambdabot https://hackage.haskell.org/package/lambdabot https://github.com/lambdabot/lambdabot
2022-12-23 10:02:28 +0100 <lambdabot> I will remember.
2022-12-23 10:02:29 +0100 <Jadesheit[m]> thank you
2022-12-23 10:02:36 +0100 <mauke> the wiki is out of date
2022-12-23 10:05:51 +0100 <Inst> in general, though, is an imperative algorithm just a hylomorphism?
2022-12-23 10:05:57 +0100freeside(~mengwong@103.252.202.159) (Ping timeout: 265 seconds)
2022-12-23 10:06:27 +0100 <Inst> or rather, can a for loop be categorized as a hylomorphism?
2022-12-23 10:07:30 +0100 <Inst> tbh, no, i'm wrong, it's a traversal
2022-12-23 10:09:11 +0100 <Inst> nah, i'm still probably wrong, traversals are the essence of the iterator pattern
2022-12-23 10:09:13 +0100tromp(~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) (Quit: My iMac has gone to sleep. ZZZzzz…)
2022-12-23 10:12:23 +0100eggplantade(~Eggplanta@2600:1700:38c5:d800:1dcc:166b:1177:c3e0)
2022-12-23 10:16:20 +0100arahael(~arahael@193-119-109-208.tpgi.com.au) (Ping timeout: 246 seconds)
2022-12-23 10:16:41 +0100eggplantade(~Eggplanta@2600:1700:38c5:d800:1dcc:166b:1177:c3e0) (Ping timeout: 246 seconds)
2022-12-23 10:23:00 +0100econo(uid147250@user/econo) (Quit: Connection closed for inactivity)
2022-12-23 10:23:15 +0100arahael(~arahael@193-119-109-208.tpgi.com.au)
2022-12-23 10:25:34 +0100bollu(~bollu@159.65.151.13) (Ping timeout: 260 seconds)
2022-12-23 10:26:32 +0100freeside(~mengwong@103.252.202.159)
2022-12-23 10:27:17 +0100thongpv87(~thongpv87@2402:9d80:346:901d:126:7968:86ee:f4cf) (Remote host closed the connection)
2022-12-23 10:27:36 +0100thongpv87(~thongpv87@2402:9d80:346:901d:bbbb:324b:8132:73e8)
2022-12-23 10:33:19 +0100freeside(~mengwong@103.252.202.159) (Ping timeout: 252 seconds)
2022-12-23 10:36:29 +0100arahael(~arahael@193-119-109-208.tpgi.com.au) (Read error: Connection reset by peer)
2022-12-23 10:43:03 +0100troydm(~troydm@host-176-37-124-197.b025.la.net.ua)
2022-12-23 10:45:15 +0100Midjak(~Midjak@82.66.147.146) (Quit: Leaving)
2022-12-23 10:54:08 +0100cheater(~Username@user/cheater) (Quit: Going offline, see ya! (www.adiirc.com))
2022-12-23 10:54:28 +0100cheater(~Username@user/cheater)
2022-12-23 10:56:34 +0100Inst(~Inst@2601:6c4:4081:54f0:c13a:1faa:a088:6fcb) (Ping timeout: 252 seconds)
2022-12-23 11:01:15 +0100arahael(~arahael@193-119-109-208.tpgi.com.au)
2022-12-23 11:01:36 +0100__monty__(~toonn@user/toonn)
2022-12-23 11:01:56 +0100mc47(~mc47@xmonad/TheMC47)
2022-12-23 11:07:49 +0100azimut(~azimut@gateway/tor-sasl/azimut) (Quit: ZNC - https://znc.in)
2022-12-23 11:08:30 +0100azimut(~azimut@gateway/tor-sasl/azimut)
2022-12-23 11:11:58 +0100tabaqui(~root@88.231.57.48) (Ping timeout: 272 seconds)
2022-12-23 11:12:29 +0100Lycurgus(~juan@user/Lycurgus)
2022-12-23 11:18:03 +0100tzh(~tzh@c-24-21-73-154.hsd1.wa.comcast.net) (Quit: zzz)
2022-12-23 11:18:13 +0100waleee(~waleee@2001:9b0:213:7200:cc36:a556:b1e8:b340)
2022-12-23 11:19:41 +0100raym(~ray@user/raym) (Quit: server reboot)
2022-12-23 11:20:12 +0100Kaiepi(~Kaiepi@108.175.84.104) (Ping timeout: 272 seconds)
2022-12-23 11:20:13 +0100fserucas(~fserucas@a85-138-107-42.cpe.netcabo.pt)
2022-12-23 11:25:16 +0100xff0x(~xff0x@125x103x176x34.ap125.ftth.ucom.ne.jp) (Ping timeout: 272 seconds)
2022-12-23 11:25:49 +0100Lycurgus(~juan@user/Lycurgus) (Quit: Exeunt: personae.ai-integration.biz)
2022-12-23 11:26:04 +0100`2jt(~jtomas@84.red-88-17-186.dynamicip.rima-tde.net)
2022-12-23 11:26:12 +0100akegalj(~akegalj@93-136-77-137.adsl.net.t-com.hr)
2022-12-23 11:27:22 +0100shapr(~user@68.54.166.125) (Ping timeout: 252 seconds)
2022-12-23 11:27:45 +0100Lord_of_Life_(~Lord@user/lord-of-life/x-2819915)
2022-12-23 11:28:13 +0100Lord_of_Life(~Lord@user/lord-of-life/x-2819915) (Ping timeout: 260 seconds)
2022-12-23 11:30:35 +0100Lord_of_Life_Lord_of_Life
2022-12-23 11:30:46 +0100tromp(~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl)
2022-12-23 11:35:19 +0100thongpv87(~thongpv87@2402:9d80:346:901d:bbbb:324b:8132:73e8) (Ping timeout: 260 seconds)
2022-12-23 11:36:15 +0100 <cheater> [exa] hi
2022-12-23 11:36:57 +0100 <Jadesheit[m]> hello
2022-12-23 11:37:27 +0100 <Jadesheit[m]> https://en.wikipedia.org/wiki/Haskell,_Texas
2022-12-23 11:43:27 +0100 <Hecate> indeed
2022-12-23 11:43:28 +0100Vajb(~Vajb@2001:999:250:c9:8588:6e93:7809:7816) (Read error: Connection reset by peer)
2022-12-23 11:44:03 +0100akegalj(~akegalj@93-136-77-137.adsl.net.t-com.hr) (Quit: leaving)
2022-12-23 11:44:43 +0100Vajb(~Vajb@hag-jnsbng11-58c3a5-27.dhcp.inet.fi)
2022-12-23 11:50:54 +0100bgs(~bgs@212-85-160-171.dynamic.telemach.net)
2022-12-23 11:50:59 +0100unit73e(~emanuel@2001:818:e8dd:7c00:656:e5ff:fe72:9d36)
2022-12-23 11:51:25 +0100werneta(~werneta@70-142-214-115.lightspeed.irvnca.sbcglobal.net) (Ping timeout: 252 seconds)
2022-12-23 11:53:15 +0100werneta(~werneta@70-142-214-115.lightspeed.irvnca.sbcglobal.net)
2022-12-23 11:53:53 +0100cheater(~Username@user/cheater) (Ping timeout: 260 seconds)
2022-12-23 11:55:00 +0100kenaryn(~aurele@cre71-h03-89-88-44-27.dsl.sta.abo.bbox.fr)
2022-12-23 11:56:00 +0100CiaoSen(~Jura@p200300c9571ee1002a3a4dfffe84dbd5.dip0.t-ipconnect.de)
2022-12-23 11:58:27 +0100Vajb(~Vajb@hag-jnsbng11-58c3a5-27.dhcp.inet.fi) (Read error: Connection reset by peer)
2022-12-23 11:59:22 +0100zer0bitz(~zer0bitz@196.244.192.57) (Read error: Connection reset by peer)
2022-12-23 11:59:41 +0100Vajb(~Vajb@hag-jnsbng11-58c3a5-27.dhcp.inet.fi)
2022-12-23 12:05:02 +0100 <kjlid[m]> How do I indicate a failure when parsing an optparse-applicative option?
2022-12-23 12:07:01 +0100werneta(~werneta@70-142-214-115.lightspeed.irvnca.sbcglobal.net) (Ping timeout: 268 seconds)
2022-12-23 12:08:43 +0100werneta(~werneta@70-142-214-115.lightspeed.irvnca.sbcglobal.net)
2022-12-23 12:09:12 +0100 <Hecate> kjlid[m]: abortOption perhaps?
2022-12-23 12:09:43 +0100 <Hecate> or return a manual https://hackage.haskell.org/package/optparse-applicative-0.17.0.0/docs/Options-Applicative.html#t:…
2022-12-23 12:15:20 +0100arahael(~arahael@193-119-109-208.tpgi.com.au) (Ping timeout: 246 seconds)
2022-12-23 12:16:27 +0100xff0x(~xff0x@ai071162.d.east.v6connect.net)
2022-12-23 12:19:39 +0100werneta(~werneta@70-142-214-115.lightspeed.irvnca.sbcglobal.net) (Ping timeout: 260 seconds)
2022-12-23 12:20:21 +0100 <kjlid[m]> I wonder if I'm using the wrong type. According to the documentation: "Options: options with an argument. An option can define a reader, which converts its argument from String to the desired value, or throws a parse error if the argument does not validate correctly"
2022-12-23 12:21:08 +0100werneta(~werneta@70-142-214-115.lightspeed.irvnca.sbcglobal.net)
2022-12-23 12:22:09 +0100 <kjlid[m]> I'm not sure I'm using a reader
2022-12-23 12:23:30 +0100Kaiepi(~Kaiepi@108.175.84.104)
2022-12-23 12:23:32 +0100TheCoffeMaker(~TheCoffeM@user/thecoffemaker) (Ping timeout: 272 seconds)
2022-12-23 12:24:01 +0100waleee(~waleee@2001:9b0:213:7200:cc36:a556:b1e8:b340) (Ping timeout: 252 seconds)
2022-12-23 12:24:06 +0100TheCoffeMaker(~TheCoffeM@user/thecoffemaker)
2022-12-23 12:25:52 +0100gnalzo(~gnalzo@2a01:e0a:498:fd50:fcc6:bb5d:489a:ce8c)
2022-12-23 12:28:44 +0100L29Ah(~L29Ah@wikipedia/L29Ah)
2022-12-23 12:33:15 +0100coot(~coot@2a02:a310:e241:1b00:ec1a:e9df:79ac:66ba)
2022-12-23 12:36:45 +0100werneta(~werneta@70-142-214-115.lightspeed.irvnca.sbcglobal.net) (Ping timeout: 265 seconds)
2022-12-23 12:38:36 +0100werneta(~werneta@70-142-214-115.lightspeed.irvnca.sbcglobal.net)
2022-12-23 12:39:20 +0100bjourne(~bjorn@94.191.152.226)
2022-12-23 12:39:46 +0100 <kjlid[m]> Yeah I think I solved it with an eitherReader
2022-12-23 12:39:54 +0100 <mniip> kjlid[m], a reader in the common sense, not the "reader monad"
2022-12-23 12:42:16 +0100 <kjlid[m]> well yeah
2022-12-23 12:42:23 +0100bjourne(~bjorn@94.191.152.226) (Client Quit)
2022-12-23 12:43:59 +0100zer0bitz(~zer0bitz@196.244.192.61)
2022-12-23 12:45:08 +0100raym(~ray@user/raym)
2022-12-23 12:46:08 +0100waleee(~waleee@2001:9b0:213:7200:cc36:a556:b1e8:b340)
2022-12-23 12:50:46 +0100werneta(~werneta@70-142-214-115.lightspeed.irvnca.sbcglobal.net) (Ping timeout: 272 seconds)
2022-12-23 12:52:02 +0100werneta(~werneta@70-142-214-115.lightspeed.irvnca.sbcglobal.net)
2022-12-23 12:55:54 +0100gurkenglas(~gurkengla@p548ac72e.dip0.t-ipconnect.de)
2022-12-23 12:58:31 +0100werneta(~werneta@70-142-214-115.lightspeed.irvnca.sbcglobal.net) (Ping timeout: 252 seconds)
2022-12-23 13:00:23 +0100werneta(~werneta@70-142-214-115.lightspeed.irvnca.sbcglobal.net)
2022-12-23 13:02:24 +0100gnalzo(~gnalzo@2a01:e0a:498:fd50:fcc6:bb5d:489a:ce8c) (Quit: WeeChat 3.7.1)
2022-12-23 13:03:49 +0100freeside(~mengwong@101.100.175.180)
2022-12-23 13:05:48 +0100waleee(~waleee@2001:9b0:213:7200:cc36:a556:b1e8:b340) (Quit: WeeChat 3.7.1)
2022-12-23 13:07:27 +0100akegalj(~akegalj@141-136-145-147.dsl.iskon.hr)
2022-12-23 13:08:11 +0100freeside(~mengwong@101.100.175.180) (Ping timeout: 248 seconds)
2022-12-23 13:14:14 +0100werneta(~werneta@70-142-214-115.lightspeed.irvnca.sbcglobal.net) (Ping timeout: 268 seconds)
2022-12-23 13:15:57 +0100werneta(~werneta@70-142-214-115.lightspeed.irvnca.sbcglobal.net)
2022-12-23 13:20:08 +0100thongpv87(~thongpv87@2402:9d80:34e:5a49:8993:bc07:c810:9d83)
2022-12-23 13:24:53 +0100werneta(~werneta@70-142-214-115.lightspeed.irvnca.sbcglobal.net) (Ping timeout: 260 seconds)
2022-12-23 13:26:21 +0100werneta(~werneta@70-142-214-115.lightspeed.irvnca.sbcglobal.net)
2022-12-23 13:28:24 +0100fizbin(~fizbin@user/fizbin)
2022-12-23 13:31:12 +0100freeside(~mengwong@101.100.175.180)
2022-12-23 13:31:18 +0100jakalx(~jakalx@base.jakalx.net) ()
2022-12-23 13:32:20 +0100phma(~phma@host-67-44-208-203.hnremote.net) (Read error: Connection reset by peer)
2022-12-23 13:33:14 +0100phma(phma@2001:5b0:210d:bff8:d3d6:20cf:c049:77a5)
2022-12-23 13:33:19 +0100CiaoSen(~Jura@p200300c9571ee1002a3a4dfffe84dbd5.dip0.t-ipconnect.de) (Ping timeout: 252 seconds)
2022-12-23 13:36:05 +0100kenaryn(~aurele@cre71-h03-89-88-44-27.dsl.sta.abo.bbox.fr) (Quit: leaving)
2022-12-23 13:36:11 +0100freeside(~mengwong@101.100.175.180) (Ping timeout: 264 seconds)
2022-12-23 13:36:56 +0100werneta(~werneta@70-142-214-115.lightspeed.irvnca.sbcglobal.net) (Ping timeout: 246 seconds)
2022-12-23 13:39:20 +0100TheCoffeMaker(~TheCoffeM@user/thecoffemaker) (Ping timeout: 246 seconds)
2022-12-23 13:39:32 +0100tromp(~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) (Quit: My iMac has gone to sleep. ZZZzzz…)
2022-12-23 13:43:45 +0100werneta(~werneta@70-142-214-115.lightspeed.irvnca.sbcglobal.net)
2022-12-23 13:44:30 +0100coot(~coot@2a02:a310:e241:1b00:ec1a:e9df:79ac:66ba) (Quit: coot)
2022-12-23 13:45:53 +0100TheCoffeMaker(~TheCoffeM@user/thecoffemaker)
2022-12-23 13:46:10 +0100jakalx(~jakalx@base.jakalx.net)
2022-12-23 13:48:15 +0100 <unit73e> now that I think about, didn't Rust also try to copy Haskell, but poorly?
2022-12-23 13:48:54 +0100 <stefan-_> xml-conduit's Text.XML.Cursor does not have very good error handling, it just returns an empty result if for example an attribute is missing, is there a better way to parse xml which also produces human-readable errors?
2022-12-23 13:52:04 +0100 <unit73e> stefan-_, what I usually do is search on hackage: https://hackage.haskell.org/packages/search?terms=xml
2022-12-23 13:52:06 +0100 <unit73e> and just pick one
2022-12-23 13:52:26 +0100 <unit73e> there's haxpat and haxml
2022-12-23 13:52:26 +0100 <c_wraith> what sort of errors? malformed xml? failed schema validation? Some sort of additional semantic layer?
2022-12-23 13:52:50 +0100 <unit73e> but yeah it seems a rather popular package to have those kinds of problems
2022-12-23 13:53:44 +0100 <stefan-_> c_wraith, if for example an attribute is queried for, then the processing should fail with an error message "missing attribute"
2022-12-23 13:54:04 +0100 <stefan-_> malformed xml would also be nice, I guess most xml libraries do this already
2022-12-23 13:54:06 +0100 <c_wraith> that doesn't sound like any kind of xml error condition I'm aware of
2022-12-23 13:54:12 +0100 <stefan-_> for schema there is no need
2022-12-23 13:54:34 +0100dextaa4(~DV@user/dextaa)
2022-12-23 13:54:59 +0100 <unit73e> an attribute doesn't necessarily have to exist to be queried, it can just return nothing
2022-12-23 13:55:12 +0100 <unit73e> *to be queried, and fail
2022-12-23 13:55:56 +0100 <stefan-_> correction: "if for example an attribute which is queried for is missing"
2022-12-23 13:56:43 +0100dextaa(~DV@user/dextaa) (Ping timeout: 260 seconds)
2022-12-23 13:56:44 +0100dextaa4dextaa
2022-12-23 13:57:29 +0100 <unit73e> stefan-_, so be clear, you're calling 'attribute :: Name -> Cursor' and returns []?
2022-12-23 13:58:15 +0100 <unit73e> but you want that function to fail if the attribute doesn't exist?
2022-12-23 13:58:17 +0100 <stefan-_> correct, attribute :: Name -> Cursor -> [T.Text] returns an empty list
2022-12-23 13:58:21 +0100 <stefan-_> yep :)
2022-12-23 14:00:20 +0100freeside(~mengwong@101.100.175.180)
2022-12-23 14:00:53 +0100 <c_wraith> I don't see how else it could possibly indicate that there are zero matching attributes...
2022-12-23 14:02:43 +0100 <stefan-_> c_wraith, with this I need to do the error handling manually, I thought there would be an existing monad-like parser
2022-12-23 14:03:47 +0100 <Rembane> You could see empty list as failure if you squint. A `[a]` is in some ways a much more powerful `Maybe a` where Nothing is empty list and `Just a` is a list with one element.
2022-12-23 14:04:16 +0100 <unit73e> so attribute returns all attributes that exist, and [] if there's none. Looks okay to me. yeah [] means it doesn't have any.
2022-12-23 14:04:28 +0100 <unit73e> why not check with that?
2022-12-23 14:04:33 +0100 <c_wraith> like, that's *not* an error condition
2022-12-23 14:04:40 +0100 <c_wraith> that's why there's no error logic involved
2022-12-23 14:04:48 +0100freeside(~mengwong@101.100.175.180) (Ping timeout: 268 seconds)
2022-12-23 14:05:15 +0100 <unit73e> agreed, I'd use the same library if I'm used to it. not that there's anything wrong with others like haxml or whatever
2022-12-23 14:05:28 +0100 <unit73e> and just figure out with code what to do
2022-12-23 14:05:32 +0100 <unit73e> or want to do
2022-12-23 14:06:57 +0100 <unit73e> also there's check and other functions that.. check.. conditions
2022-12-23 14:08:35 +0100werneta(~werneta@70-142-214-115.lightspeed.irvnca.sbcglobal.net) (Ping timeout: 264 seconds)
2022-12-23 14:10:25 +0100werneta(~werneta@70-142-214-115.lightspeed.irvnca.sbcglobal.net)
2022-12-23 14:10:56 +0100cheater(~Username@user/cheater)
2022-12-23 14:11:58 +0100 <stefan-_> so, that basically means "roll your own error-handling"?
2022-12-23 14:12:44 +0100Guest17(~Guest17@194.42.11.29)
2022-12-23 14:13:03 +0100tromp(~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl)
2022-12-23 14:13:19 +0100 <unit73e> yeah because failing because an attribute doesn't exist is not really that common
2022-12-23 14:14:07 +0100 <unit73e> that's more like, logic you want in your application
2022-12-23 14:14:07 +0100Guest17(~Guest17@194.42.11.29) (Client Quit)
2022-12-23 14:15:59 +0100eggplantade(~Eggplanta@2600:1700:38c5:d800:1dcc:166b:1177:c3e0)
2022-12-23 14:16:27 +0100 <unit73e> you can easily roll out your own Exception or Either, pick your poison, and make it all monadic
2022-12-23 14:16:48 +0100fizbin(~fizbin@user/fizbin) (Ping timeout: 260 seconds)
2022-12-23 14:18:34 +0100 <stefan-_> ok, thanks
2022-12-23 14:18:49 +0100werneta(~werneta@70-142-214-115.lightspeed.irvnca.sbcglobal.net) (Ping timeout: 252 seconds)
2022-12-23 14:19:25 +0100 <stefan-_> then one more question, say I have this name: "Martín Abadi", having this as Text and printing it out shows: "Mart\237n Abadi"
2022-12-23 14:19:43 +0100 <stefan-_> is that the common behaviour for Text with non-ascii characters?
2022-12-23 14:20:17 +0100eggplantade(~Eggplanta@2600:1700:38c5:d800:1dcc:166b:1177:c3e0) (Ping timeout: 252 seconds)
2022-12-23 14:20:25 +0100 <stefan-_> unpacking as String and printing it shows: "Martín Abadi"
2022-12-23 14:20:47 +0100werneta(~werneta@70-142-214-115.lightspeed.irvnca.sbcglobal.net)
2022-12-23 14:24:26 +0100freeside(~mengwong@101.100.175.180)
2022-12-23 14:25:11 +0100 <unit73e> statusbot, you should use Data.Text.IO.putStrLn or Text.Printf if you need it
2022-12-23 14:25:37 +0100 <unit73e> lol wrong person
2022-12-23 14:25:41 +0100 <unit73e> stefan-_, see above
2022-12-23 14:27:55 +0100 <stefan-_> coolio, thanks
2022-12-23 14:28:08 +0100 <stefan-_> am I right that this is a "feature" of the Show instance for Text?
2022-12-23 14:28:43 +0100freeside(~mengwong@101.100.175.180) (Ping timeout: 248 seconds)
2022-12-23 14:29:22 +0100 <unit73e> it's sort of a feature. the thing is Text can have multiple encodings, so it will show unicode with Show
2022-12-23 14:29:50 +0100 <unit73e> I think utf-8 is the default afaik
2022-12-23 14:31:00 +0100 <unit73e> so basically what matter is Show is showing unicode because that's what Text actually stores
2022-12-23 14:31:16 +0100gnalzo(~gnalzo@2a01:e0a:498:fd50:fcc6:bb5d:489a:ce8c)
2022-12-23 14:32:31 +0100Guest323(~finn@roc37-h01-176-170-197-243.dsl.sta.abo.bbox.fr)
2022-12-23 14:32:46 +0100 <__monty__> I think Data.Text uses UTF-16 internally.
2022-12-23 14:34:36 +0100 <__monty__> I think the Show instance uses escape codes because that's more reliable. Show isn't for rendering pretty things, it's to give a String representation of a value that can (usually) be parsed back into the value by passing it to the corresponding `read`.
2022-12-23 14:35:07 +0100werneta(~werneta@70-142-214-115.lightspeed.irvnca.sbcglobal.net) (Ping timeout: 248 seconds)
2022-12-23 14:35:08 +0100 <__monty__> String is just as "unicode" as Text is BTW, it's not restricted to ASCII.
2022-12-23 14:36:20 +0100 <stefan-_> ok, makes sense, thanks for the explanations
2022-12-23 14:36:27 +0100fizbin(~fizbin@user/fizbin)
2022-12-23 14:36:53 +0100werneta(~werneta@70-142-214-115.lightspeed.irvnca.sbcglobal.net)
2022-12-23 14:41:43 +0100 <geekosaur> Text 2.x is UTF-8 internally
2022-12-23 14:42:22 +0100acarrico(~acarrico@dhcp-68-142-49-34.greenmountainaccess.net) (Quit: Leaving.)
2022-12-23 14:43:02 +0100fizbin(~fizbin@user/fizbin) (Ping timeout: 268 seconds)
2022-12-23 14:43:23 +0100Kaiepi(~Kaiepi@108.175.84.104) (Ping timeout: 246 seconds)
2022-12-23 14:44:51 +0100gurkenglas(~gurkengla@p548ac72e.dip0.t-ipconnect.de) (Ping timeout: 252 seconds)
2022-12-23 14:44:54 +0100Kaiepi(~Kaiepi@108.175.84.104)
2022-12-23 14:47:28 +0100ReinhildeMelMalik
2022-12-23 14:48:04 +0100werneta(~werneta@70-142-214-115.lightspeed.irvnca.sbcglobal.net) (Ping timeout: 260 seconds)
2022-12-23 14:49:31 +0100werneta(~werneta@70-142-214-115.lightspeed.irvnca.sbcglobal.net)
2022-12-23 14:49:58 +0100AlexNoo(~AlexNoo@94.233.241.57) (Read error: Connection reset by peer)
2022-12-23 14:50:21 +0100AlexNoo(~AlexNoo@94.233.241.57)
2022-12-23 14:50:37 +0100coot(~coot@213.134.171.3)
2022-12-23 14:52:59 +0100[itchyjunk](~itchyjunk@user/itchyjunk/x-7353470)
2022-12-23 14:54:00 +0100AlexNoo(~AlexNoo@94.233.241.57) (Read error: Connection reset by peer)
2022-12-23 14:55:44 +0100freeside(~mengwong@101.100.175.180)
2022-12-23 14:57:24 +0100gurkenglas(~gurkengla@84.138.199.46)
2022-12-23 14:57:24 +0100AlexZenon(~alzenon@94.233.241.57) (Ping timeout: 265 seconds)
2022-12-23 14:57:31 +0100Alex_test(~al_test@94.233.241.57) (Ping timeout: 248 seconds)
2022-12-23 14:57:59 +0100 <mauke> > "Martín Abadi"
2022-12-23 14:58:01 +0100 <lambdabot> "Mart\237n Abadi"
2022-12-23 14:58:27 +0100 <mauke> also the Show instance for String
2022-12-23 14:58:36 +0100 <unit73e> looks like it
2022-12-23 14:58:54 +0100 <unit73e> yeah tested in ghci, same result
2022-12-23 14:59:17 +0100 <unit73e> so it's always unicode
2022-12-23 15:00:06 +0100freeside(~mengwong@101.100.175.180) (Ping timeout: 255 seconds)
2022-12-23 15:03:33 +0100jmdaemon(~jmdaemon@user/jmdaemon) (Ping timeout: 252 seconds)
2022-12-23 15:06:19 +0100CiaoSen(~Jura@p200300c9571ee1002a3a4dfffe84dbd5.dip0.t-ipconnect.de)
2022-12-23 15:08:58 +0100 <__monty__> geekosaur: Thanks!
2022-12-23 15:09:06 +0100werneta(~werneta@70-142-214-115.lightspeed.irvnca.sbcglobal.net) (Ping timeout: 255 seconds)
2022-12-23 15:09:39 +0100 <geekosaur> > text "Martín Abadi" -- hack for lambdabot
2022-12-23 15:09:41 +0100 <lambdabot> Martín Abadi
2022-12-23 15:10:16 +0100 <Jadesheit[m]> @src (<*>)
2022-12-23 15:10:17 +0100 <lambdabot> Source not found. Abort, Retry, Panic?
2022-12-23 15:10:21 +0100freeside(~mengwong@101.100.175.180)
2022-12-23 15:10:21 +0100 <geekosaur> the prettyprinting lib lambdabot has loaded has a Show instance of id for String. (I don't think it supports Text.)
2022-12-23 15:10:56 +0100 <geekosaur> actually for Doc, which `text` converts String into
2022-12-23 15:11:04 +0100werneta(~werneta@70-142-214-115.lightspeed.irvnca.sbcglobal.net)
2022-12-23 15:11:16 +0100 <geekosaur> and the @src database predates Applicative so none of those are in it
2022-12-23 15:12:03 +0100 <geekosaur> it's not actually looking up the source, it's dumping from a small database mostly populated from the Haskell 98 Report
2022-12-23 15:12:23 +0100thegeekinside(~thegeekin@189.128.148.159)
2022-12-23 15:13:09 +0100 <[itchyjunk]> Woha, I am reading an article on "Promises" in js and apparently, Haskell order of operation is already like this ( idk what "this" mean but let me vaguely point to the univers)
2022-12-23 15:13:50 +0100 <__monty__> [itchyjunk]: The "this" is probably referring to call-by-need semantics?
2022-12-23 15:14:10 +0100 <mauke> yes, <- (in a do block) is a lot like await (in an async function)
2022-12-23 15:14:26 +0100 <mauke> and >>= correspinds to .then()
2022-12-23 15:14:32 +0100troydm(~troydm@host-176-37-124-197.b025.la.net.ua) (Ping timeout: 272 seconds)
2022-12-23 15:14:49 +0100 <[itchyjunk]> hmm, something like that. http://robotlolita.me/2015/11/15/how-do-promises-work.html
2022-12-23 15:15:06 +0100 <[itchyjunk]> :o
2022-12-23 15:17:15 +0100jakalx(~jakalx@base.jakalx.net) (Error from remote client)
2022-12-23 15:18:08 +0100 <mauke> ah, that's about laziness in general
2022-12-23 15:18:33 +0100jakalx(~jakalx@base.jakalx.net)
2022-12-23 15:18:45 +0100Kaipei(~Kaiepi@108.175.84.104)
2022-12-23 15:21:02 +0100Unicorn_Princess(~Unicorn_P@user/Unicorn-Princess/x-3540542)
2022-12-23 15:21:54 +0100Kaiepi(~Kaiepi@108.175.84.104) (Ping timeout: 260 seconds)
2022-12-23 15:22:05 +0100slack1256(~slack1256@186.11.29.60) (Remote host closed the connection)
2022-12-23 15:22:13 +0100AlexNoo(~AlexNoo@178.34.150.54)
2022-12-23 15:23:03 +0100AlexZenon(~alzenon@178.34.150.54)
2022-12-23 15:23:31 +0100Alex_test(~al_test@178.34.150.54)
2022-12-23 15:27:12 +0100werneta(~werneta@70-142-214-115.lightspeed.irvnca.sbcglobal.net) (Ping timeout: 272 seconds)
2022-12-23 15:27:52 +0100 <Jadesheit[m]> How is the list monad instance defined using list comprehension?
2022-12-23 15:28:10 +0100 <Jadesheit[m]> Does it not desugar to itself?
2022-12-23 15:28:36 +0100werneta(~werneta@70-142-214-115.lightspeed.irvnca.sbcglobal.net)
2022-12-23 15:28:53 +0100Kaiepi(~Kaiepi@108.175.84.104)
2022-12-23 15:29:01 +0100 <geekosaur> list coomprehensions actually desugar to regular functions, unless MonadComprehensions is enabled in the source file
2022-12-23 15:29:29 +0100Kaipei(~Kaiepi@108.175.84.104) (Ping timeout: 260 seconds)
2022-12-23 15:30:01 +0100 <mauke> @undo [ f x | x <- xs, p x ]
2022-12-23 15:30:01 +0100 <lambdabot> concatMap (\ x -> if p x then [f x] else []) xs
2022-12-23 15:30:20 +0100bunnyhamer(~bunnyhame@2a10:8012:21:46dc:6456:24ad:beee:35aa)
2022-12-23 15:30:28 +0100 <Jadesheit[m]> geekosaur: how would `[y | x <- xs, y <- f x]` desugar then?
2022-12-23 15:30:36 +0100 <Jadesheit[m]> oh
2022-12-23 15:30:39 +0100 <Jadesheit[m]> @undo [y | x <- xs, y <- f x]
2022-12-23 15:30:39 +0100 <lambdabot> concatMap (\ x -> concatMap (\ y -> [y]) (f x)) xs
2022-12-23 15:31:59 +0100 <Jadesheit[m]> Why is the monad instance for `[]` not `(>>=) = concatMap`
2022-12-23 15:32:28 +0100 <geekosaur> :t concatMap
2022-12-23 15:32:29 +0100 <lambdabot> Foldable t => (a -> [b]) -> t a -> [b]
2022-12-23 15:32:52 +0100 <geekosaur> it's reversed. concatMap is actually =<< iirc
2022-12-23 15:33:20 +0100 <Rembane> :t (=<<)
2022-12-23 15:33:21 +0100 <lambdabot> Monad m => (a -> m b) -> m a -> m b
2022-12-23 15:33:39 +0100Rembanesquints
2022-12-23 15:33:39 +0100 <Rembane> Yup
2022-12-23 15:34:33 +0100 <Jadesheit[m]> ah yeah
2022-12-23 15:34:48 +0100 <Jadesheit[m]> `(>>=) = flip concatMap`
2022-12-23 15:35:12 +0100 <Jadesheit[m]> wait no it's not
2022-12-23 15:35:23 +0100werneta(~werneta@70-142-214-115.lightspeed.irvnca.sbcglobal.net) (Ping timeout: 256 seconds)
2022-12-23 15:35:40 +0100manj-gnome(~manjaro-g@85.195.196.52)
2022-12-23 15:36:04 +0100Guest323(~finn@roc37-h01-176-170-197-243.dsl.sta.abo.bbox.fr) (Ping timeout: 272 seconds)
2022-12-23 15:36:56 +0100werneta(~werneta@70-142-214-115.lightspeed.irvnca.sbcglobal.net)
2022-12-23 15:38:05 +0100 <Rembane> Jadesheit[m]: I like that definition: https://hackage.haskell.org/package/base-4.17.0.0/docs/src/GHC.Base.html#%3D%3C%3C
2022-12-23 15:41:23 +0100 <mauke> Jadesheit[m]: https://hackage.haskell.org/package/base-4.17.0.0/docs/src/GHC.Base.html#line-315
2022-12-23 15:42:17 +0100 <Rembane> TIL! Sweet!
2022-12-23 15:50:00 +0100freeside(~mengwong@101.100.175.180) (Ping timeout: 272 seconds)
2022-12-23 15:53:09 +0100motherfsck(~motherfsc@user/motherfsck)
2022-12-23 15:59:23 +0100werneta(~werneta@70-142-214-115.lightspeed.irvnca.sbcglobal.net) (Ping timeout: 246 seconds)
2022-12-23 15:59:57 +0100tromp(~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) (Quit: My iMac has gone to sleep. ZZZzzz…)
2022-12-23 16:00:39 +0100themc47(~mc47@xmonad/TheMC47)
2022-12-23 16:00:44 +0100 <unit73e> Yesterday I had did an interview with a Junior for a Java+React position, but I asked what a Monad was just as a joke, but joke's on me because he was able to explain what a monad is. we're getting somewhere.
2022-12-23 16:01:34 +0100werneta(~werneta@70-142-214-115.lightspeed.irvnca.sbcglobal.net)
2022-12-23 16:01:45 +0100 <unit73e> no he didn't open a browser to see, he explained some functions and laws
2022-12-23 16:02:10 +0100mc47(~mc47@xmonad/TheMC47) (Read error: Connection reset by peer)
2022-12-23 16:03:54 +0100 <Jadesheit[m]> very nice
2022-12-23 16:04:33 +0100 <Rembane> unit73e: Awesome!
2022-12-23 16:04:34 +0100 <Jadesheit[m]> so many people now start saying "A monad is a monoid in the category of endofunctors" when I talk about monads on a java server
2022-12-23 16:04:36 +0100 <Jadesheit[m]> because of the meme
2022-12-23 16:04:42 +0100 <Rembane> Good meme
2022-12-23 16:06:47 +0100 <Jadesheit[m]> indeed
2022-12-23 16:06:54 +0100werneta(~werneta@70-142-214-115.lightspeed.irvnca.sbcglobal.net) (Ping timeout: 268 seconds)
2022-12-23 16:08:21 +0100werneta(~werneta@70-142-214-115.lightspeed.irvnca.sbcglobal.net)
2022-12-23 16:08:52 +0100shriekingnoise(~shrieking@186.137.167.202)
2022-12-23 16:10:59 +0100Sauvin(~sauvin@user/Sauvin) (Remote host closed the connection)
2022-12-23 16:11:21 +0100Sauvin(~sauvin@user/Sauvin)
2022-12-23 16:13:35 +0100werneta(~werneta@70-142-214-115.lightspeed.irvnca.sbcglobal.net) (Ping timeout: 252 seconds)
2022-12-23 16:14:24 +0100mikoto-chan(~mikoto-ch@85-76-3-8-nat.elisa-mobile.fi)
2022-12-23 16:14:39 +0100werneta(~werneta@70-142-214-115.lightspeed.irvnca.sbcglobal.net)
2022-12-23 16:16:43 +0100tromp(~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl)
2022-12-23 16:17:38 +0100eggplantade(~Eggplanta@2600:1700:38c5:d800:1dcc:166b:1177:c3e0)
2022-12-23 16:17:51 +0100freeside(~mengwong@101.100.175.180)
2022-12-23 16:19:39 +0100werneta(~werneta@70-142-214-115.lightspeed.irvnca.sbcglobal.net) (Ping timeout: 260 seconds)
2022-12-23 16:21:21 +0100werneta(~werneta@70-142-214-115.lightspeed.irvnca.sbcglobal.net)
2022-12-23 16:22:20 +0100eggplantade(~Eggplanta@2600:1700:38c5:d800:1dcc:166b:1177:c3e0) (Ping timeout: 260 seconds)
2022-12-23 16:22:34 +0100freeside(~mengwong@101.100.175.180) (Ping timeout: 260 seconds)
2022-12-23 16:22:47 +0100igghibu(~igghibu@178.249.211.100)
2022-12-23 16:23:15 +0100jakalx(~jakalx@base.jakalx.net) (Error from remote client)
2022-12-23 16:26:55 +0100igghibu(~igghibu@178.249.211.100) (Client Quit)
2022-12-23 16:27:35 +0100igghibu(~igghibu@178.249.211.100)
2022-12-23 16:27:55 +0100akegalj(~akegalj@141-136-145-147.dsl.iskon.hr) (Quit: leaving)
2022-12-23 16:28:58 +0100jakalx(~jakalx@base.jakalx.net)
2022-12-23 16:31:25 +0100pavonia(~user@user/siracusa) (Quit: Bye!)
2022-12-23 16:33:04 +0100werneta(~werneta@70-142-214-115.lightspeed.irvnca.sbcglobal.net) (Ping timeout: 272 seconds)
2022-12-23 16:33:05 +0100igghibu(~igghibu@178.249.211.100) (Quit: WeeChat 3.7.1)
2022-12-23 16:33:22 +0100igghibu(~igghibu@178.249.211.100)
2022-12-23 16:34:47 +0100werneta(~werneta@70-142-214-115.lightspeed.irvnca.sbcglobal.net)
2022-12-23 16:38:54 +0100Sgeo(~Sgeo@user/sgeo)
2022-12-23 16:39:45 +0100bunnyhamer(~bunnyhame@2a10:8012:21:46dc:6456:24ad:beee:35aa) (Quit: Client closed)
2022-12-23 16:40:02 +0100werneta(~werneta@70-142-214-115.lightspeed.irvnca.sbcglobal.net) (Ping timeout: 272 seconds)
2022-12-23 16:40:44 +0100werneta(~werneta@70-142-214-115.lightspeed.irvnca.sbcglobal.net)
2022-12-23 16:43:56 +0100Guest323(~finn@roc37-h01-176-170-197-243.dsl.sta.abo.bbox.fr)
2022-12-23 16:46:13 +0100werneta(~werneta@70-142-214-115.lightspeed.irvnca.sbcglobal.net) (Ping timeout: 256 seconds)
2022-12-23 16:46:51 +0100werneta(~werneta@70-142-214-115.lightspeed.irvnca.sbcglobal.net)
2022-12-23 16:50:25 +0100freeside(~mengwong@101.100.175.180)
2022-12-23 16:50:36 +0100MajorBiscuit(~MajorBisc@31-23-159.netrun.cytanet.com.cy) (Quit: WeeChat 3.6)
2022-12-23 16:51:18 +0100jimki(~jmaki@gazorpazorp.fixme.fi) (Ping timeout: 268 seconds)
2022-12-23 16:54:47 +0100freeside(~mengwong@101.100.175.180) (Ping timeout: 264 seconds)
2022-12-23 16:54:47 +0100werneta(~werneta@70-142-214-115.lightspeed.irvnca.sbcglobal.net) (Ping timeout: 264 seconds)
2022-12-23 16:56:13 +0100werneta(~werneta@70-142-214-115.lightspeed.irvnca.sbcglobal.net)
2022-12-23 16:58:39 +0100jimki(~jmaki@gazorpazorp.fixme.fi)
2022-12-23 16:59:10 +0100caryhartline(~caryhartl@2600:1700:2d0:8d30:68e0:626e:e762:49ca)
2022-12-23 17:05:00 +0100werneta(~werneta@70-142-214-115.lightspeed.irvnca.sbcglobal.net) (Ping timeout: 265 seconds)
2022-12-23 17:06:36 +0100werneta(~werneta@70-142-214-115.lightspeed.irvnca.sbcglobal.net)
2022-12-23 17:09:30 +0100beteigeuze(~Thunderbi@bl14-81-220.dsl.telepac.pt)
2022-12-23 17:09:30 +0100beteigeuze(~Thunderbi@bl14-81-220.dsl.telepac.pt) (Client Quit)
2022-12-23 17:09:43 +0100beteigeuze(~Thunderbi@bl14-81-220.dsl.telepac.pt)
2022-12-23 17:12:15 +0100werneta(~werneta@70-142-214-115.lightspeed.irvnca.sbcglobal.net) (Ping timeout: 265 seconds)
2022-12-23 17:12:54 +0100werneta(~werneta@70-142-214-115.lightspeed.irvnca.sbcglobal.net)
2022-12-23 17:15:31 +0100freeside(~mengwong@101.100.175.180)
2022-12-23 17:16:17 +0100razetime(~quassel@49.207.230.181) (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.)
2022-12-23 17:17:41 +0100igghibu(~igghibu@178.249.211.100) (Quit: igghibu)
2022-12-23 17:17:55 +0100igghibu(~igghibu@178.249.211.100)
2022-12-23 17:18:11 +0100werneta(~werneta@70-142-214-115.lightspeed.irvnca.sbcglobal.net) (Ping timeout: 264 seconds)
2022-12-23 17:18:38 +0100werneta(~werneta@70-142-214-115.lightspeed.irvnca.sbcglobal.net)
2022-12-23 17:18:54 +0100califax(~califax@user/califx) (Quit: ZNC 1.8.2 - https://znc.in)
2022-12-23 17:19:55 +0100freeside(~mengwong@101.100.175.180) (Ping timeout: 248 seconds)
2022-12-23 17:20:58 +0100califax(~califax@user/califx)
2022-12-23 17:21:08 +0100gurkenglas(~gurkengla@84.138.199.46) (Ping timeout: 260 seconds)
2022-12-23 17:22:09 +0100gnalzo(~gnalzo@2a01:e0a:498:fd50:fcc6:bb5d:489a:ce8c) (Quit: WeeChat 3.7.1)
2022-12-23 17:25:19 +0100werneta(~werneta@70-142-214-115.lightspeed.irvnca.sbcglobal.net) (Ping timeout: 260 seconds)
2022-12-23 17:26:54 +0100texasmynsted(~texasmyns@99.96.221.112) (Ping timeout: 272 seconds)
2022-12-23 17:26:58 +0100werneta(~werneta@70-142-214-115.lightspeed.irvnca.sbcglobal.net)
2022-12-23 17:27:01 +0100manj-gnome(~manjaro-g@85.195.196.52) (Quit: Leaving)
2022-12-23 17:27:19 +0100mikoto-chan(~mikoto-ch@85-76-3-8-nat.elisa-mobile.fi) (Ping timeout: 260 seconds)
2022-12-23 17:28:38 +0100motherfsck(~motherfsc@user/motherfsck) (Quit: quit)
2022-12-23 17:28:49 +0100mikoto-chan(~mikoto-ch@85-76-142-82-nat.elisa-mobile.fi)
2022-12-23 17:30:41 +0100themc47(~mc47@xmonad/TheMC47) (Remote host closed the connection)
2022-12-23 17:31:01 +0100themc47(~mc47@xmonad/TheMC47)
2022-12-23 17:31:06 +0100themc47(~mc47@xmonad/TheMC47) (Client Quit)
2022-12-23 17:33:19 +0100Heffalump(~ganesh@urchin.earth.li)
2022-12-23 17:33:38 +0100califax(~califax@user/califx) (Ping timeout: 255 seconds)
2022-12-23 17:33:50 +0100 <Heffalump> what's the best way to request a GHC bug fix that's already committed on master be backported to 9.4.x?
2022-12-23 17:34:44 +0100tromp(~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) (Quit: My iMac has gone to sleep. ZZZzzz…)
2022-12-23 17:35:15 +0100califax(~califax@user/califx)
2022-12-23 17:35:41 +0100freeside(~mengwong@101.100.175.180)
2022-12-23 17:37:10 +0100dsrt^(~dsrt@76.145.185.103)
2022-12-23 17:39:40 +0100mauke(~mauke@user/mauke) (Quit: leaving)
2022-12-23 17:39:50 +0100freeside(~mengwong@101.100.175.180) (Ping timeout: 246 seconds)
2022-12-23 17:40:39 +0100mauke(~mauke@user/mauke)
2022-12-23 17:41:06 +0100kenran(~user@user/kenran)
2022-12-23 17:41:07 +0100mbuf(~Shakthi@49.204.130.4) (Quit: Leaving)
2022-12-23 17:41:14 +0100kenran(~user@user/kenran) (Remote host closed the connection)
2022-12-23 17:45:25 +0100 <lyxia> open an issue?
2022-12-23 17:45:47 +0100 <Heffalump> lyxia: open a new issue rather than commenting on the existing one?
2022-12-23 17:46:44 +0100 <monochrom> Ugh please don't bring up monads in java communities. :( Here in #haskell we don't bring up checked exceptions either. :D
2022-12-23 17:50:14 +0100Kaipei(~Kaiepi@108.175.84.104)
2022-12-23 17:51:07 +0100werneta(~werneta@70-142-214-115.lightspeed.irvnca.sbcglobal.net) (Ping timeout: 268 seconds)
2022-12-23 17:51:11 +0100CiaoSen(~Jura@p200300c9571ee1002a3a4dfffe84dbd5.dip0.t-ipconnect.de) (Ping timeout: 264 seconds)
2022-12-23 17:52:05 +0100bitdex(~bitdex@gateway/tor-sasl/bitdex) (Ping timeout: 255 seconds)
2022-12-23 17:52:50 +0100tromp(~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl)
2022-12-23 17:52:52 +0100Kaiepi(~Kaiepi@108.175.84.104) (Ping timeout: 272 seconds)
2022-12-23 17:52:52 +0100werneta(~werneta@70-142-214-115.lightspeed.irvnca.sbcglobal.net)
2022-12-23 17:54:31 +0100eggplantade(~Eggplanta@2600:1700:38c5:d800:1dcc:166b:1177:c3e0)
2022-12-23 17:54:53 +0100bitdex(~bitdex@gateway/tor-sasl/bitdex)
2022-12-23 17:57:11 +0100`2jt(~jtomas@84.red-88-17-186.dynamicip.rima-tde.net) (Ping timeout: 264 seconds)
2022-12-23 18:00:21 +0100freeside(~mengwong@101.100.175.180)
2022-12-23 18:04:41 +0100hpc(~juzz@ip98-169-35-163.dc.dc.cox.net) (Ping timeout: 268 seconds)
2022-12-23 18:04:54 +0100werneta(~werneta@70-142-214-115.lightspeed.irvnca.sbcglobal.net) (Ping timeout: 272 seconds)
2022-12-23 18:04:54 +0100Kaipei(~Kaiepi@108.175.84.104) (Ping timeout: 272 seconds)
2022-12-23 18:05:03 +0100jpds2(~jpds@gateway/tor-sasl/jpds) (Remote host closed the connection)
2022-12-23 18:05:03 +0100azimut(~azimut@gateway/tor-sasl/azimut) (Remote host closed the connection)
2022-12-23 18:05:06 +0100 <lyxia> Heffalump: yeah
2022-12-23 18:05:18 +0100freeside(~mengwong@101.100.175.180) (Ping timeout: 268 seconds)
2022-12-23 18:05:53 +0100jpds2(~jpds@gateway/tor-sasl/jpds)
2022-12-23 18:06:16 +0100hpc(~juzz@ip98-169-35-163.dc.dc.cox.net)
2022-12-23 18:06:17 +0100werneta(~werneta@70-142-214-115.lightspeed.irvnca.sbcglobal.net)
2022-12-23 18:06:48 +0100 <geekosaur> if you have access, I think you're also supposed to attach the issue to the appropriate milestone
2022-12-23 18:07:51 +0100azimut(~azimut@gateway/tor-sasl/azimut)
2022-12-23 18:10:35 +0100hpc(~juzz@ip98-169-35-163.dc.dc.cox.net) (Ping timeout: 248 seconds)
2022-12-23 18:12:02 +0100thongpv87(~thongpv87@2402:9d80:34e:5a49:8993:bc07:c810:9d83) (Ping timeout: 246 seconds)
2022-12-23 18:16:29 +0100hpc(~juzz@ip98-169-35-163.dc.dc.cox.net)
2022-12-23 18:18:03 +0100werneta(~werneta@70-142-214-115.lightspeed.irvnca.sbcglobal.net) (Ping timeout: 248 seconds)
2022-12-23 18:19:22 +0100seriously_guest(~seriously@2001:1c06:2715:c200:3b35:92eb:bf95:36ea)
2022-12-23 18:19:42 +0100werneta(~werneta@70-142-214-115.lightspeed.irvnca.sbcglobal.net)
2022-12-23 18:20:40 +0100 <Profpatsch> Hm, can I have a Coercible instance for a type with a “smart” constructor?
2022-12-23 18:21:03 +0100 <Profpatsch> In particular, I’d like to be able to coerce in and out of the `Label` type here https://gist.github.com/Profpatsch/c1992885fd28294968c549e2237ced3f
2022-12-23 18:21:05 +0100 <geekosaur> not if the real constructor is hidden
2022-12-23 18:21:11 +0100Vajb(~Vajb@hag-jnsbng11-58c3a5-27.dhcp.inet.fi) (Read error: Connection reset by peer)
2022-12-23 18:21:20 +0100Vajb(~Vajb@2001:999:250:c9:8588:6e93:7809:7816)
2022-12-23 18:21:22 +0100 <Profpatsch> But I don’t want to export the constructor, otherwise people start matching on it, but I want them to use the HasField instance
2022-12-23 18:21:26 +0100 <geekosaur> you may need a .Internal module which exposes it
2022-12-23 18:22:00 +0100 <Profpatsch> eh, it’s just an optimization anyway
2022-12-23 18:22:08 +0100 <Profpatsch> in that case I’ll just manually map
2022-12-23 18:22:17 +0100 <Profpatsch> sufficiently smart compiler and all that
2022-12-23 18:22:36 +0100 <Profpatsch> geekosaur: but good idea, if I ever put it into a library I might want to export it via .Internal
2022-12-23 18:22:48 +0100 <seriously_guest> Hey, is anyone familiar with Excercise 3 of Yorgey CIS194 HW 10? https://www.cis.upenn.edu/~cis1940/spring13/hw/10-applicative.pdf . I don't understand this line " Do not implement
2022-12-23 18:22:49 +0100 <seriously_guest> them using the low-level definition of a Parser! In other words, pre-
2022-12-23 18:22:49 +0100 <seriously_guest> tend that you do not have access to the Parser constructor or even
2022-12-23 18:22:50 +0100 <seriously_guest> know how the Parser type is defined."
2022-12-23 18:23:22 +0100 <Profpatsch> seriously_guest: don’t use the right side of the Parser difinition
2022-12-23 18:23:24 +0100 <Profpatsch> *definition
2022-12-23 18:24:02 +0100 <seriously_guest> Profpatsch how would I write this function without using the Parser constructor? abParser :: Parser (Char, Char)
2022-12-23 18:24:30 +0100 <Profpatsch> seriously_guest: given that you implemented an Applicative instance just before
2022-12-23 18:24:56 +0100tromp(~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) (Quit: My iMac has gone to sleep. ZZZzzz…)
2022-12-23 18:25:03 +0100 <Profpatsch> You want to use the functions from Applicative to turn a :: Parser Char b :: Parser Char into abParser :: Parser (Char, Char)
2022-12-23 18:25:20 +0100 <Profpatsch> so you can get a feel for how Applicative works
2022-12-23 18:25:30 +0100 <seriously_guest> ok gotcha thanks for the hint
2022-12-23 18:26:10 +0100 <Profpatsch> seriously_guest: If you want to make sure you are doing the right thing, implement the function abParserA :: Applicative m => m (Char, Char) instead
2022-12-23 18:26:36 +0100 <Profpatsch> You can use it everywhere you’d use `abParser`, but in the definition you are restricted to only things that Applicative gives you
2022-12-23 18:26:57 +0100fizbin(~fizbin@user/fizbin)
2022-12-23 18:27:06 +0100 <Profpatsch> In fact, you can use it for anything that implements Applicative, not just parsers
2022-12-23 18:27:23 +0100 <Profpatsch> So you could use it as abParserA :: IO (Char, Char)
2022-12-23 18:27:57 +0100 <seriously_guest> *thumbsup*
2022-12-23 18:30:09 +0100tromp(~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl)
2022-12-23 18:30:47 +0100werneta(~werneta@70-142-214-115.lightspeed.irvnca.sbcglobal.net) (Ping timeout: 264 seconds)
2022-12-23 18:31:20 +0100 <Profpatsch> seriously_guest: correction, abParserA :: Applicative m => m Char -> m (Char, Char)
2022-12-23 18:31:30 +0100hpc(~juzz@ip98-169-35-163.dc.dc.cox.net) (Ping timeout: 272 seconds)
2022-12-23 18:32:07 +0100werneta(~werneta@70-142-214-115.lightspeed.irvnca.sbcglobal.net)
2022-12-23 18:35:32 +0100Neuromancer(~Neuromanc@user/neuromancer)
2022-12-23 18:36:22 +0100Guest323(~finn@roc37-h01-176-170-197-243.dsl.sta.abo.bbox.fr) (Ping timeout: 252 seconds)
2022-12-23 18:38:23 +0100econo(uid147250@user/econo)
2022-12-23 18:39:04 +0100werneta(~werneta@70-142-214-115.lightspeed.irvnca.sbcglobal.net) (Ping timeout: 260 seconds)
2022-12-23 18:40:29 +0100werneta(~werneta@70-142-214-115.lightspeed.irvnca.sbcglobal.net)
2022-12-23 18:42:07 +0100gnalzo(~gnalzo@2a01:e0a:498:fd50:fcc6:bb5d:489a:ce8c)
2022-12-23 18:42:46 +0100 <seriously_guest> sorry to bother Profpatsch, but is this cheating according to the assignment? https://paste.tomsmeding.com/MjsokyUC
2022-12-23 18:43:24 +0100 <seriously_guest> theres a function char :: Char -> Parser Char thats defined in the hw already; but that techically uses the Parser constructor itself
2022-12-23 18:46:02 +0100FragByte(~christian@user/fragbyte) (Ping timeout: 252 seconds)
2022-12-23 18:46:51 +0100FragByte(~christian@user/fragbyte)
2022-12-23 18:47:13 +0100 <int-e> seriously_guest: That's fine. You're putting together simpler parsers (defined earlier) into more complex ones.
2022-12-23 18:47:25 +0100 <int-e> > (,) 1 'a'
2022-12-23 18:47:27 +0100 <lambdabot> (1,'a')
2022-12-23 18:47:41 +0100 <int-e> seriously_guest: you don't really need pairCons, that's just (,)
2022-12-23 18:47:54 +0100 <seriously_guest> ^^thanks for that; was looking for something simpler
2022-12-23 18:49:05 +0100werneta(~werneta@70-142-214-115.lightspeed.irvnca.sbcglobal.net) (Ping timeout: 268 seconds)
2022-12-23 18:50:51 +0100werneta(~werneta@70-142-214-115.lightspeed.irvnca.sbcglobal.net)
2022-12-23 18:51:33 +0100Kaiepi(~Kaiepi@2605:b100:b28:783c:5975:664c:67a5:edf)
2022-12-23 18:55:59 +0100zmt00(~zmt00@user/zmt00)
2022-12-23 18:56:08 +0100werneta(~werneta@70-142-214-115.lightspeed.irvnca.sbcglobal.net) (Ping timeout: 246 seconds)
2022-12-23 18:56:10 +0100unit73e(~emanuel@2001:818:e8dd:7c00:656:e5ff:fe72:9d36) (Ping timeout: 252 seconds)
2022-12-23 18:56:57 +0100tromp(~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) (Quit: My iMac has gone to sleep. ZZZzzz…)
2022-12-23 18:58:11 +0100werneta(~werneta@70-142-214-115.lightspeed.irvnca.sbcglobal.net)
2022-12-23 18:58:22 +0100zmt01(~zmt00@user/zmt00) (Ping timeout: 252 seconds)
2022-12-23 19:01:42 +0100Bocaneri(~sauvin@user/Sauvin)
2022-12-23 19:01:58 +0100mvk(~mvk@2607:fea8:5ce3:8500::6126)
2022-12-23 19:02:05 +0100BocaneriGuest4522
2022-12-23 19:02:32 +0100igghibu(~igghibu@178.249.211.100) (Quit: igghibu)
2022-12-23 19:03:02 +0100 <Profpatsch> seriously_guest: yeah, I’d say that’s the correct solution
2022-12-23 19:03:30 +0100 <Profpatsch> seriously_guest: if you want to go fancy you can enable ApplicativeDo notation, then you can write
2022-12-23 19:03:32 +0100 <Profpatsch> do
2022-12-23 19:03:37 +0100 <Profpatsch> a <- char 'a'
2022-12-23 19:03:39 +0100 <Profpatsch> b <- char 'b'
2022-12-23 19:03:42 +0100 <Profpatsch> pure (a, b)
2022-12-23 19:04:26 +0100Sauvin(~sauvin@user/Sauvin) (Ping timeout: 272 seconds)
2022-12-23 19:04:27 +0100igghibu(~igghibu@178.249.211.100)
2022-12-23 19:05:10 +0100acidjnk(~acidjnk@p200300d6e7137a614441a736a9b750c4.dip0.t-ipconnect.de)
2022-12-23 19:05:35 +0100 <Profpatsch> (I wanted to link the GHC user guide page on that extension here but then I read the page and … lol … a simple concept described in the most complicated way possible)
2022-12-23 19:05:59 +0100 <Profpatsch> The Haskell Foundation really needs to hire some good techincal writers
2022-12-23 19:06:09 +0100 <Profpatsch> *technical
2022-12-23 19:08:30 +0100 <seriously_guest> tbh, Im trying my hardest not to use any language options until I get to a point where i've mastered everything that comes out the box in ghc
2022-12-23 19:09:14 +0100 <seriously_guest> otherwise I won't know how we got there... might be the wrong approach but it helps me feel less stressed
2022-12-23 19:09:39 +0100 <seriously_guest> but thank you
2022-12-23 19:09:51 +0100werneta(~werneta@70-142-214-115.lightspeed.irvnca.sbcglobal.net) (Ping timeout: 260 seconds)
2022-12-23 19:11:38 +0100werneta(~werneta@70-142-214-115.lightspeed.irvnca.sbcglobal.net)
2022-12-23 19:12:05 +0100Ram-Z_(Ram-Z@2a01:7e01::f03c:91ff:fe57:d2df) (Ping timeout: 255 seconds)
2022-12-23 19:12:47 +0100vpan(~0@212.117.1.172) (Quit: Leaving.)
2022-12-23 19:13:59 +0100Ram-Z(~Ram-Z@li1814-254.members.linode.com)
2022-12-23 19:17:11 +0100mvk(~mvk@2607:fea8:5ce3:8500::6126) (Quit: Going elsewhere)
2022-12-23 19:18:15 +0100werneta(~werneta@70-142-214-115.lightspeed.irvnca.sbcglobal.net) (Ping timeout: 260 seconds)
2022-12-23 19:19:59 +0100werneta(~werneta@70-142-214-115.lightspeed.irvnca.sbcglobal.net)
2022-12-23 19:20:16 +0100fizbin(~fizbin@user/fizbin) (Ping timeout: 272 seconds)
2022-12-23 19:23:07 +0100freeside(~mengwong@103.252.202.159)
2022-12-23 19:24:48 +0100cheater_(~Username@user/cheater)
2022-12-23 19:25:34 +0100trev(~trev@user/trev) (Remote host closed the connection)
2022-12-23 19:27:35 +0100cheater(~Username@user/cheater) (Ping timeout: 260 seconds)
2022-12-23 19:27:43 +0100cheater_cheater
2022-12-23 19:29:01 +0100seriously_guest(~seriously@2001:1c06:2715:c200:3b35:92eb:bf95:36ea) (Quit: Client closed)
2022-12-23 19:30:22 +0100tromp(~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl)
2022-12-23 19:32:43 +0100werneta(~werneta@70-142-214-115.lightspeed.irvnca.sbcglobal.net) (Ping timeout: 248 seconds)
2022-12-23 19:34:32 +0100werneta(~werneta@70-142-214-115.lightspeed.irvnca.sbcglobal.net)
2022-12-23 19:36:01 +0100jakalx(~jakalx@base.jakalx.net) ()
2022-12-23 19:41:35 +0100werneta(~werneta@70-142-214-115.lightspeed.irvnca.sbcglobal.net) (Ping timeout: 264 seconds)
2022-12-23 19:42:20 +0100motherfsck(~motherfsc@user/motherfsck)
2022-12-23 19:42:54 +0100werneta(~werneta@70-142-214-115.lightspeed.irvnca.sbcglobal.net)
2022-12-23 19:45:21 +0100jakalx(~jakalx@base.jakalx.net)
2022-12-23 19:46:13 +0100igghibu(~igghibu@178.249.211.100) (Quit: igghibu)
2022-12-23 19:47:52 +0100hpc(~juzz@ip98-169-35-163.dc.dc.cox.net)
2022-12-23 19:48:41 +0100werneta(~werneta@70-142-214-115.lightspeed.irvnca.sbcglobal.net) (Ping timeout: 256 seconds)
2022-12-23 19:48:46 +0100fserucas(~fserucas@a85-138-107-42.cpe.netcabo.pt) (Ping timeout: 272 seconds)
2022-12-23 19:50:14 +0100werneta(~werneta@70-142-214-115.lightspeed.irvnca.sbcglobal.net)
2022-12-23 19:56:29 +0100Guest4522Sauvin
2022-12-23 19:56:55 +0100werneta(~werneta@70-142-214-115.lightspeed.irvnca.sbcglobal.net) (Ping timeout: 268 seconds)
2022-12-23 19:58:34 +0100werneta(~werneta@70-142-214-115.lightspeed.irvnca.sbcglobal.net)
2022-12-23 19:59:07 +0100finsternis(~X@23.226.237.192)
2022-12-23 20:00:00 +0100tzh(~tzh@c-24-21-73-154.hsd1.or.comcast.net)
2022-12-23 20:06:47 +0100mikoto-chan(~mikoto-ch@85-76-142-82-nat.elisa-mobile.fi) (Ping timeout: 268 seconds)
2022-12-23 20:10:25 +0100werneta(~werneta@70-142-214-115.lightspeed.irvnca.sbcglobal.net) (Ping timeout: 252 seconds)
2022-12-23 20:11:59 +0100werneta(~werneta@70-142-214-115.lightspeed.irvnca.sbcglobal.net)
2022-12-23 20:19:16 +0100 <iqubic> Parsers are really cool, yeah
2022-12-23 20:19:44 +0100werneta(~werneta@70-142-214-115.lightspeed.irvnca.sbcglobal.net) (Ping timeout: 268 seconds)
2022-12-23 20:21:28 +0100werneta(~werneta@70-142-214-115.lightspeed.irvnca.sbcglobal.net)
2022-12-23 20:22:23 +0100fryguybob(~fryguybob@cpe-74-67-169-145.rochester.res.rr.com) (Ping timeout: 264 seconds)
2022-12-23 20:27:24 +0100werneta(~werneta@70-142-214-115.lightspeed.irvnca.sbcglobal.net) (Ping timeout: 272 seconds)
2022-12-23 20:27:38 +0100werneta(~werneta@70-142-214-115.lightspeed.irvnca.sbcglobal.net)
2022-12-23 20:32:44 +0100azimut(~azimut@gateway/tor-sasl/azimut) (Ping timeout: 255 seconds)
2022-12-23 20:33:06 +0100werneta(~werneta@70-142-214-115.lightspeed.irvnca.sbcglobal.net) (Ping timeout: 272 seconds)
2022-12-23 20:33:14 +0100gmg(~user@user/gehmehgeh)
2022-12-23 20:33:43 +0100werneta(~werneta@70-142-214-115.lightspeed.irvnca.sbcglobal.net)
2022-12-23 20:34:54 +0100Guest323(~finn@roc37-h01-176-170-197-243.dsl.sta.abo.bbox.fr)
2022-12-23 20:35:07 +0100[itchyjunk](~itchyjunk@user/itchyjunk/x-7353470) (Read error: Connection reset by peer)
2022-12-23 20:36:20 +0100pavonia(~user@user/siracusa)
2022-12-23 20:39:28 +0100werneta(~werneta@70-142-214-115.lightspeed.irvnca.sbcglobal.net) (Ping timeout: 268 seconds)
2022-12-23 20:41:03 +0100werneta(~werneta@70-142-214-115.lightspeed.irvnca.sbcglobal.net)
2022-12-23 20:46:06 +0100gurkenglas(~gurkengla@p548ac72e.dip0.t-ipconnect.de)
2022-12-23 20:47:52 +0100Kaiepi(~Kaiepi@2605:b100:b28:783c:5975:664c:67a5:edf) (Read error: Connection reset by peer)
2022-12-23 20:48:43 +0100werneta(~werneta@70-142-214-115.lightspeed.irvnca.sbcglobal.net) (Ping timeout: 268 seconds)
2022-12-23 20:50:25 +0100werneta(~werneta@70-142-214-115.lightspeed.irvnca.sbcglobal.net)
2022-12-23 20:51:11 +0100tromp(~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) (Quit: My iMac has gone to sleep. ZZZzzz…)
2022-12-23 20:55:54 +0100werneta(~werneta@70-142-214-115.lightspeed.irvnca.sbcglobal.net) (Ping timeout: 272 seconds)
2022-12-23 20:56:30 +0100werneta(~werneta@70-142-214-115.lightspeed.irvnca.sbcglobal.net)
2022-12-23 21:01:21 +0100`2jt(~jtomas@84.red-88-17-186.dynamicip.rima-tde.net)
2022-12-23 21:02:03 +0100jakalx(~jakalx@base.jakalx.net) ()
2022-12-23 21:06:18 +0100jmdaemon(~jmdaemon@user/jmdaemon)
2022-12-23 21:06:52 +0100fserucas(~fserucas@a85-138-107-42.cpe.netcabo.pt)
2022-12-23 21:07:13 +0100werneta(~werneta@70-142-214-115.lightspeed.irvnca.sbcglobal.net) (Ping timeout: 268 seconds)
2022-12-23 21:08:42 +0100tromp(~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl)
2022-12-23 21:08:56 +0100werneta(~werneta@70-142-214-115.lightspeed.irvnca.sbcglobal.net)
2022-12-23 21:10:48 +0100jakalx(~jakalx@base.jakalx.net)
2022-12-23 21:12:57 +0100fserucas(~fserucas@a85-138-107-42.cpe.netcabo.pt) (Ping timeout: 265 seconds)
2022-12-23 21:19:43 +0100werneta(~werneta@70-142-214-115.lightspeed.irvnca.sbcglobal.net) (Ping timeout: 265 seconds)
2022-12-23 21:21:20 +0100werneta(~werneta@70-142-214-115.lightspeed.irvnca.sbcglobal.net)
2022-12-23 21:27:59 +0100foul_owl(~kerry@157.97.134.158) (Ping timeout: 260 seconds)
2022-12-23 21:28:11 +0100werneta(~werneta@70-142-214-115.lightspeed.irvnca.sbcglobal.net) (Ping timeout: 268 seconds)
2022-12-23 21:29:41 +0100werneta(~werneta@70-142-214-115.lightspeed.irvnca.sbcglobal.net)
2022-12-23 21:30:08 +0100fizbin(~fizbin@user/fizbin)
2022-12-23 21:37:29 +0100harveypwca(~harveypwc@2601:246:c180:a570:3828:d8:e523:3f67)
2022-12-23 21:39:35 +0100werneta(~werneta@70-142-214-115.lightspeed.irvnca.sbcglobal.net) (Ping timeout: 246 seconds)
2022-12-23 21:40:26 +0100jargon(~jargon@174-22-192-24.phnx.qwest.net)
2022-12-23 21:41:29 +0100werneta(~werneta@70-142-214-115.lightspeed.irvnca.sbcglobal.net)
2022-12-23 21:43:31 +0100foul_owl(~kerry@71.212.143.88)
2022-12-23 21:50:57 +0100caryhartline(~caryhartl@2600:1700:2d0:8d30:68e0:626e:e762:49ca) (Ping timeout: 255 seconds)
2022-12-23 21:52:10 +0100werneta(~werneta@70-142-214-115.lightspeed.irvnca.sbcglobal.net) (Ping timeout: 252 seconds)
2022-12-23 21:53:53 +0100werneta(~werneta@70-142-214-115.lightspeed.irvnca.sbcglobal.net)
2022-12-23 21:56:26 +0100Sciencentistguy(~sciencent@hacksoc/ordinary-member) (Read error: Connection reset by peer)
2022-12-23 21:56:42 +0100 <dgpratt[m]> is there an easy way to render a Rational (aka Ratio Integer) as a decimal formatted string?
2022-12-23 21:56:46 +0100Sciencentistguy(~sciencent@hacksoc/ordinary-member)
2022-12-23 21:57:07 +0100 <monochrom> I would convert to Double.
2022-12-23 21:59:52 +0100werneta(~werneta@70-142-214-115.lightspeed.irvnca.sbcglobal.net) (Ping timeout: 272 seconds)
2022-12-23 22:00:34 +0100mesaoptimizer(apotheosis@user/PapuaHardyNet)
2022-12-23 22:01:08 +0100beefbambi(~beefbambi@2401:4900:230d:f57c:538c:d7cc:50c0:e377) (Read error: Connection reset by peer)
2022-12-23 22:02:24 +0100beefbambi(~beefbambi@183.82.30.144)
2022-12-23 22:04:19 +0100 <dgpratt[m]> thanks monochrom
2022-12-23 22:06:14 +0100werneta(~werneta@70-142-214-115.lightspeed.irvnca.sbcglobal.net)
2022-12-23 22:06:55 +0100 <mauke> > unfoldr (\x -> if x == 0 then Nothing else Just (properFraction x)) (0.5 :: Rational)
2022-12-23 22:06:57 +0100 <lambdabot> [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0...
2022-12-23 22:06:57 +0100motherfsck(~motherfsc@user/motherfsck) (Ping timeout: 256 seconds)
2022-12-23 22:07:12 +0100 <mauke> > unfoldr (\x -> if x == 0 then Nothing else Just (properFraction (x * 10))) (0.5 :: Rational)
2022-12-23 22:07:13 +0100 <lambdabot> [5]
2022-12-23 22:07:27 +0100 <mauke> > unfoldr (\x -> if x == 0 then Nothing else Just (properFraction (x * 10))) (1/7 :: Rational)
2022-12-23 22:07:29 +0100 <lambdabot> [1,4,2,8,5,7,1,4,2,8,5,7,1,4,2,8,5,7,1,4,2,8,5,7,1,4,2,8,5,7,1,4,2,8,5,7,1,4...
2022-12-23 22:08:44 +0100Guest323(~finn@roc37-h01-176-170-197-243.dsl.sta.abo.bbox.fr) (Ping timeout: 272 seconds)
2022-12-23 22:09:14 +0100 <mauke> > (\n -> chr (n + ord '0')) <$> unfoldr (\x -> if x == 0 then Nothing else Just (properFraction (x * 10))) (1/7 :: Rational)
2022-12-23 22:09:16 +0100 <lambdabot> "142857142857142857142857142857142857142857142857142857142857142857142857142...
2022-12-23 22:09:57 +0100beefbambi(~beefbambi@183.82.30.144) (Read error: Connection reset by peer)
2022-12-23 22:10:20 +0100beefbambi(~beefbambi@183.82.30.144)
2022-12-23 22:15:04 +0100gurkenglas(~gurkengla@p548ac72e.dip0.t-ipconnect.de) (Ping timeout: 272 seconds)
2022-12-23 22:18:16 +0100ircbrowse_tom(~ircbrowse@2a01:4f8:1c1c:9319::1)
2022-12-23 22:18:22 +0100Server+Cnt
2022-12-23 22:18:31 +0100 <Jadesheit[m]> hahaha
2022-12-23 22:18:59 +0100werneta(~werneta@70-142-214-115.lightspeed.irvnca.sbcglobal.net) (Ping timeout: 260 seconds)
2022-12-23 22:19:19 +0100 <mauke> @let showRat r | r < 0 = '-' : showRat (negate r) | otherwise = case properFraction r of (show -> i, map (chr . (ord '0' +)) . unfoldr (\x -> if x == 0 then Nothing else Just (properFraction (x * 10))) -> f) -> i ++ case f of "" -> ""; _ -> '.' : f
2022-12-23 22:19:21 +0100 <lambdabot> Defined.
2022-12-23 22:19:34 +0100 <mauke> > showRat (1/3)
2022-12-23 22:19:35 +0100 <lambdabot> "0.333333333333333303727386009995825588703155517578125"
2022-12-23 22:19:59 +0100 <Jadesheit[m]> hm
2022-12-23 22:20:08 +0100 <mauke> > showRat (1/3 :: Rational)
2022-12-23 22:20:10 +0100 <lambdabot> "0.3333333333333333333333333333333333333333333333333333333333333333333333333...
2022-12-23 22:20:40 +0100werneta(~werneta@70-142-214-115.lightspeed.irvnca.sbcglobal.net)
2022-12-23 22:21:03 +0100 <mauke> > showRat (355/113 :: Rational)
2022-12-23 22:21:05 +0100 <lambdabot> "3.1415929203539823008849557522123893805309734513274336283185840707964601769...
2022-12-23 22:21:13 +0100beefbambi(~beefbambi@183.82.30.144) (Read error: Connection reset by peer)
2022-12-23 22:21:38 +0100 <mauke> > showRat (0/0)
2022-12-23 22:21:40 +0100 <lambdabot> "-26965397022934738615939577861835371004269654684134598591014512173659901370...
2022-12-23 22:21:47 +0100 <Jadesheit[m]> lol
2022-12-23 22:22:05 +0100 <mauke> > toRational (0/0)
2022-12-23 22:22:07 +0100 <lambdabot> (-26965397022934738615939577861835371004269654684134598591014512173659901370...
2022-12-23 22:22:14 +0100 <mauke> faithful!
2022-12-23 22:23:13 +0100 <mauke> I'm not sure why the '-' is there, though
2022-12-23 22:23:20 +0100 <mauke> > 0/0 < 0
2022-12-23 22:23:22 +0100 <lambdabot> False
2022-12-23 22:24:21 +0100 <geekosaur> becuase properFraction (which toRational uses) takes a shortcut that produces garbage for NaN
2022-12-23 22:24:37 +0100iqubic(~avi@2601:602:9502:c70:ddf2:fbad:a58:4a0b) (Ping timeout: 252 seconds)
2022-12-23 22:24:42 +0100 <geekosaur> (also for Inf and -Inf, not that Rational has those)
2022-12-23 22:24:50 +0100 <mauke> I'm not using properFraction for negative numbers
2022-12-23 22:25:04 +0100 <mauke> ooh
2022-12-23 22:25:10 +0100 <mauke> I get it
2022-12-23 22:26:10 +0100 <mauke> I thought it was my '-', but it is show's '-'
2022-12-23 22:37:43 +0100beefbambi(~beefbambi@183.82.30.144)
2022-12-23 22:38:53 +0100gmg(~user@user/gehmehgeh) (Remote host closed the connection)
2022-12-23 22:40:05 +0100morb(~morb@pool-72-80-94-112.nycmny.fios.verizon.net)
2022-12-23 22:41:48 +0100gmg(~user@user/gehmehgeh)
2022-12-23 22:42:32 +0100unit73e(~emanuel@2001:818:e8dd:7c00:656:e5ff:fe72:9d36)
2022-12-23 22:42:44 +0100 <talismanick> Is there a "write your own effect system" tutorial anywhere?
2022-12-23 22:43:11 +0100 <talismanick> from free monad guts to something simple like lexi-lambda's effect system
2022-12-23 22:43:43 +0100 <talismanick> https://github.com/lexi-lambda/freer-simple
2022-12-23 22:43:51 +0100 <talismanick> Freer monads, I suppose I should say
2022-12-23 22:49:20 +0100Inst(~Inst@2601:6c4:4081:54f0:b86b:c7d7:3fe0:861c)
2022-12-23 22:49:25 +0100 <Inst> int-e
2022-12-23 22:49:33 +0100 <Inst> wait, did you just show me an optimized foldmap with foldb?
2022-12-23 22:50:02 +0100 <Inst> that's actually pretty interesting, i'm wondering how to implement it imperatively
2022-12-23 22:51:11 +0100pwug(~pwug@user/pwug)
2022-12-23 22:53:27 +0100 <talismanick> Oh, and speaking of effects, has anyone provided a correct implementation (or integration) of non-determinism since this was published? https://github.com/lexi-lambda/eff/blob/8c4df4bf54faf22456354be18095b14825be5e85/notes/semantics-z…
2022-12-23 23:05:44 +0100coot(~coot@213.134.171.3) (Quit: coot)
2022-12-23 23:06:25 +0100coot(~coot@2a02:a310:e241:1b00:ec1a:e9df:79ac:66ba)
2022-12-23 23:06:32 +0100coot(~coot@2a02:a310:e241:1b00:ec1a:e9df:79ac:66ba) (Remote host closed the connection)
2022-12-23 23:26:56 +0100tromp(~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) (Quit: My iMac has gone to sleep. ZZZzzz…)
2022-12-23 23:29:24 +0100morb(~morb@pool-72-80-94-112.nycmny.fios.verizon.net) (Remote host closed the connection)
2022-12-23 23:36:08 +0100thegeekinside(~thegeekin@189.128.148.159) (Ping timeout: 272 seconds)
2022-12-23 23:36:16 +0100tromp(~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl)
2022-12-23 23:38:02 +0100troydm(~troydm@host-176-37-124-197.b025.la.net.ua)
2022-12-23 23:38:50 +0100morb(~morb@pool-72-80-94-112.nycmny.fios.verizon.net)
2022-12-23 23:40:34 +0100werneta(~werneta@70-142-214-115.lightspeed.irvnca.sbcglobal.net) (Ping timeout: 272 seconds)
2022-12-23 23:42:13 +0100werneta(~werneta@70-142-214-115.lightspeed.irvnca.sbcglobal.net)
2022-12-23 23:43:18 +0100morb(~morb@pool-72-80-94-112.nycmny.fios.verizon.net) (Remote host closed the connection)
2022-12-23 23:44:00 +0100cheater_(~Username@user/cheater)
2022-12-23 23:44:42 +0100bgs(~bgs@212-85-160-171.dynamic.telemach.net) (Remote host closed the connection)
2022-12-23 23:47:32 +0100cheater(~Username@user/cheater) (Ping timeout: 272 seconds)
2022-12-23 23:47:35 +0100cheater_cheater
2022-12-23 23:48:04 +0100tromp(~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) (Quit: My iMac has gone to sleep. ZZZzzz…)
2022-12-23 23:49:06 +0100__monty__(~toonn@user/toonn) (Quit: leaving)
2022-12-23 23:49:33 +0100biberu(~biberu@user/biberu) (Read error: Connection reset by peer)
2022-12-23 23:51:29 +0100fizbin(~fizbin@user/fizbin) (Ping timeout: 246 seconds)
2022-12-23 23:52:02 +0100beefbambi(~beefbambi@183.82.30.144) (Read error: Connection reset by peer)
2022-12-23 23:52:36 +0100beefbambi(~beefbambi@183.82.30.144)
2022-12-23 23:53:38 +0100takuan(~takuan@178-116-218-225.access.telenet.be) (Quit: Lost terminal)
2022-12-23 23:55:34 +0100thegeekinside(~thegeekin@189.128.148.159)
2022-12-23 23:56:11 +0100werneta(~werneta@70-142-214-115.lightspeed.irvnca.sbcglobal.net) (Ping timeout: 268 seconds)
2022-12-23 23:57:09 +0100biberu(~biberu@user/biberu)
2022-12-23 23:57:40 +0100werneta(~werneta@70-142-214-115.lightspeed.irvnca.sbcglobal.net)
2022-12-23 23:58:51 +0100freeside(~mengwong@103.252.202.159) (Ping timeout: 248 seconds)