2021/09/11

2021-09-11 00:02:44 +0200favonia(~favonia@user/favonia) (Ping timeout: 265 seconds)
2021-09-11 00:04:40 +0200lavaman(~lavaman@98.38.249.169) (Ping timeout: 265 seconds)
2021-09-11 00:07:45 +0200mikoto-chan(~mikoto-ch@83.137.2.248)
2021-09-11 00:08:05 +0200Guest46(~Guest46@pool-108-17-124-115.pitbpa.fios.verizon.net) (Quit: Client closed)
2021-09-11 00:11:31 +0200michalz(~michalz@185.246.204.41) (Remote host closed the connection)
2021-09-11 00:12:36 +0200gioyik(~gioyik@gateway/tor-sasl/gioyik)
2021-09-11 00:14:11 +0200wonko(~wjc@62.115.229.50) (Ping timeout: 252 seconds)
2021-09-11 00:19:13 +0200amitnjha(~amit@024-216-124-116.res.spectrum.com) (Quit: amitnjha)
2021-09-11 00:19:26 +0200amitnjha(~amit@024-216-124-116.res.spectrum.com)
2021-09-11 00:19:45 +0200xff0x(~xff0x@2001:1a81:531e:3c00:3db9:e43a:c387:7efa) (Ping timeout: 260 seconds)
2021-09-11 00:20:34 +0200xff0x(~xff0x@2001:1a81:531e:3c00:25c1:193a:5cc2:a16c)
2021-09-11 00:21:12 +0200 <mrianbloom> svlc I got it working with cabal 3.6, thank you.
2021-09-11 00:22:08 +0200gehmehgeh(~user@user/gehmehgeh) (Quit: Leaving)
2021-09-11 00:23:56 +0200 <janus> with Aeson, if i have a 'Parser (Maybe a)' and an error message, how do i make a 'Parser a'? i have '\errMsg -> join . fmap (maybe (fail errMsg) pure)' but i feel like i am reinventing the wheel
2021-09-11 00:24:00 +0200benin0369323(~benin@183.82.24.241)
2021-09-11 00:25:27 +0200 <janus> :t \errMsg -> join . fmap (maybe (fail errMsg) pure)
2021-09-11 00:25:28 +0200 <lambdabot> MonadFail m => String -> m (Maybe a) -> m a
2021-09-11 00:26:32 +0200 <adamse> you could go with `\msg -> (>>= maybe (fail msg) pure)`
2021-09-11 00:26:45 +0200 <adamse> :t \msg -> (>>= maybe (fail msg) pure)
2021-09-11 00:26:46 +0200 <lambdabot> MonadFail m => String -> m (Maybe b) -> m b
2021-09-11 00:28:19 +0200vicfred(~vicfred@user/vicfred)
2021-09-11 00:29:13 +0200Tuplanolla(~Tuplanoll@91-159-69-50.elisa-laajakaista.fi)
2021-09-11 00:29:41 +0200 <janus> it just feels like it should be such a common thing to turn a Nothing into a fail inside a functor
2021-09-11 00:31:19 +0200 <janus> maybe i should specialize to Aeson and make it "Parser a -> (a -> Maybe b) -> Parser b -> Parser b" where the third param would be the failure
2021-09-11 00:32:12 +0200 <janus> in a minute it's gonna be traverse or sequenceA :P
2021-09-11 00:35:04 +0200 <adamse> :t fromMaybe (fail "err") . sequenceA
2021-09-11 00:35:05 +0200 <lambdabot> (MonadFail m, Traversable m) => m (Maybe a) -> m a
2021-09-11 00:35:26 +0200 <adamse> maybe not...
2021-09-11 00:36:36 +0200 <janus> well Parser is not Traversable ..
2021-09-11 00:36:59 +0200 <monochrom> I don't feel it common at all. If I need a mandatory X, I would have Parser X in the first place.
2021-09-11 00:38:31 +0200 <janus> well Aeson is full of functions that return 'Parser (Maybe a)', so it doesn't seem like they discourage having a Maybe inside. But i do get your point
2021-09-11 00:39:33 +0200[itchyjunk](~itchyjunk@user/itchyjunk/x-7353470)
2021-09-11 00:40:13 +0200 <monochrom> I use (.:)
2021-09-11 00:40:51 +0200 <janus> witherable has mapMaybe which is "Filterable f => (a -> Maybe b) -> f a -> fb" which is a generalization of 'Parser a -> (a -> Maybe b) -> Parser b -> Parser b'
2021-09-11 00:41:02 +0200 <monochrom> If I used (.:?) it would be because I really considered a field to be optional, not any kind of error condition if it's missing.
2021-09-11 00:42:06 +0200 <janus> thing is, i am working with a type that has no FromJSON instance, so i am calling _their_ function to get a 'Maybe theirType'. so it's either orphan or this. and i prefer this over orphan
2021-09-11 00:43:10 +0200 <monochrom> I respect that, but it is not common.
2021-09-11 00:44:33 +0200amitnjha(~amit@024-216-124-116.res.spectrum.com) (Quit: amitnjha)
2021-09-11 00:44:46 +0200amitnjha(~amit@024-216-124-116.res.spectrum.com)
2021-09-11 00:45:38 +0200Erutuon(~Erutuon@user/erutuon)
2021-09-11 00:45:39 +0200kayprish_(~kayprish@cable-188-2-153-140.dynamic.sbb.rs) (Remote host closed the connection)
2021-09-11 00:48:55 +0200vysn(~vysn@user/vysn) (Ping timeout: 260 seconds)
2021-09-11 00:50:42 +0200 <mrianbloom> sclv I got it working with cabal 3.6, thank you.
2021-09-11 00:51:35 +0200gioyik_(~gioyik@gateway/tor-sasl/gioyik)
2021-09-11 00:55:42 +0200gioyik(~gioyik@gateway/tor-sasl/gioyik) (Ping timeout: 276 seconds)
2021-09-11 00:57:08 +0200random-jellyfish(~random-je@user/random-jellyfish)
2021-09-11 00:58:28 +0200aegon(~mike@174.127.249.180)
2021-09-11 00:58:48 +0200 <aegon> hey all, does the fusion step / system in ghc have access to lifted nats / datakinds / that level of machinery?
2021-09-11 01:03:30 +0200pmk(~user@2a02:587:9416:c4cd:a38a:dea2:e28e:646d) (Ping timeout: 260 seconds)
2021-09-11 01:08:45 +0200TranquilEcho(~grom@user/tranquilecho) (Ping timeout: 260 seconds)
2021-09-11 01:12:08 +0200 <aegon> * rewrite rules
2021-09-11 01:15:14 +0200jtomas(~jtomas@95.red-88-11-64.dynamicip.rima-tde.net) (Ping timeout: 265 seconds)
2021-09-11 01:15:17 +0200favonia(~favonia@user/favonia)
2021-09-11 01:18:36 +0200shapr(~user@pool-100-36-247-68.washdc.fios.verizon.net) (Remote host closed the connection)
2021-09-11 01:19:26 +0200son0p(~ff@181.136.122.143) (Remote host closed the connection)
2021-09-11 01:26:21 +0200wroathe(~wroathe@user/wroathe) (Ping timeout: 265 seconds)
2021-09-11 01:29:53 +0200harveypwca(~harveypwc@2601:246:c180:a570:2435:ba7:e573:bc26)
2021-09-11 01:32:18 +0200machinedgod(~machinedg@135-23-192-217.cpe.pppoe.ca) (Ping timeout: 260 seconds)
2021-09-11 01:32:46 +0200acidjnk_new(~acidjnk@p200300d0c720304924f33c3f96bd7d34.dip0.t-ipconnect.de) (Ping timeout: 260 seconds)
2021-09-11 01:33:57 +0200zaquest(~notzaques@5.128.210.178) (Quit: Leaving)
2021-09-11 01:35:25 +0200zaquest(~notzaques@5.128.210.178)
2021-09-11 01:44:13 +0200 <ldlework> I'm annoyed every module I wanna doctest needs a main
2021-09-11 01:44:53 +0200amitnjha(~amit@024-216-124-116.res.spectrum.com) (Quit: amitnjha)
2021-09-11 01:45:11 +0200amitnjha(~amit@024-216-124-116.res.spectrum.com)
2021-09-11 01:45:14 +0200epolanski(uid312403@id-312403.helmsley.irccloud.com) (Quit: Connection closed for inactivity)
2021-09-11 01:49:14 +0200Codaraxis_(~Codaraxis@user/codaraxis)
2021-09-11 01:49:19 +0200cheater(~Username@user/cheater) (Quit: (BitchX) Life is like BitchX. Ya never know what yer gunna git.)
2021-09-11 01:50:27 +0200 <ldlework> It'd also be cool if doctest had a flag to you the cases it was testing
2021-09-11 01:51:15 +0200wroathe(~wroathe@c-68-54-25-135.hsd1.mn.comcast.net)
2021-09-11 01:51:16 +0200wroathe(~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Changing host)
2021-09-11 01:51:16 +0200wroathe(~wroathe@user/wroathe)
2021-09-11 01:53:18 +0200Codaraxis(~Codaraxis@user/codaraxis) (Ping timeout: 260 seconds)
2021-09-11 01:53:29 +0200 <lechner> Hi, what's a nice way to deal with long string literals in Lucid templates, please?
2021-09-11 01:53:51 +0200gioyik(~gioyik@gateway/tor-sasl/gioyik)
2021-09-11 01:54:57 +0200 <awpr> lechner: not sure if this answers your question, but you can break strings onto multiple lines by surrounding whitespace in backslashes
2021-09-11 01:55:56 +0200 <monochrom> Here is an example. I have spaces, but line breaks are OK too:
2021-09-11 01:56:03 +0200 <monochrom> > "ab\ \c"
2021-09-11 01:56:04 +0200 <lambdabot> "abc"
2021-09-11 01:56:21 +0200cheater(~Username@user/cheater)
2021-09-11 01:56:43 +0200 <monochrom> You can have line breaks there. You can have extra spaces to get indentation to look right too.
2021-09-11 01:56:48 +0200gioyik_(~gioyik@gateway/tor-sasl/gioyik) (Ping timeout: 276 seconds)
2021-09-11 01:57:07 +0200 <monochrom> > "abc" == "ab\ \c"
2021-09-11 01:57:09 +0200 <lambdabot> True
2021-09-11 01:57:56 +0200 <glguy> but you better have *some* whitespace in there
2021-09-11 01:58:00 +0200 <glguy> > "ab\\c"
2021-09-11 01:58:01 +0200 <lambdabot> "ab\\c"
2021-09-11 01:58:07 +0200random-jellyfish(~random-je@user/random-jellyfish) (Ping timeout: 256 seconds)
2021-09-11 01:58:09 +0200 <monochrom> Yeah :)
2021-09-11 01:58:42 +0200 <awpr> > "ab\​\c"
2021-09-11 01:58:43 +0200 <lambdabot> <hint>:1:5: error:
2021-09-11 01:58:44 +0200 <lambdabot> lexical error in string/character literal at character '\8203'
2021-09-11 01:58:48 +0200 <monochrom> I usually don't warn about these details because programmers don't troll themselves with corner cases.
2021-09-11 01:59:03 +0200awprjust trolled himself with a corner case...
2021-09-11 01:59:16 +0200chomwitt(~chomwitt@2a02:587:dc14:5d00:12c3:7bff:fe6d:d374) (Ping timeout: 252 seconds)
2021-09-11 01:59:49 +0200proofofkeags_(~proofofke@205.209.28.54) (Ping timeout: 252 seconds)
2021-09-11 02:02:13 +0200 <lechner> awpr monochrom glguy: thanks! that works like a charm, and emacs indents it right too
2021-09-11 02:04:54 +0200 <monochrom> Sometimes the syntax colourer is confused. But if you delete one of the quotes and enter again, it is right again.
2021-09-11 02:05:06 +0200pretty_dumm_guy(trottel@gateway/vpn/protonvpn/prettydummguy/x-88029655) (Quit: WeeChat 3.2.1)
2021-09-11 02:05:13 +0200amitnjha(~amit@024-216-124-116.res.spectrum.com) (Quit: amitnjha)
2021-09-11 02:05:22 +0200 <glguy> When I'm using vim I press ^L to get syntax highlighting back in order
2021-09-11 02:05:27 +0200amitnjha(~amit@024-216-124-116.res.spectrum.com)
2021-09-11 02:05:49 +0200 <glguy> I don't know where else that works, but it works there :)
2021-09-11 02:06:27 +0200Tuplanolla(~Tuplanoll@91-159-69-50.elisa-laajakaista.fi) (Quit: Leaving.)
2021-09-11 02:10:04 +0200 <hololeap> a pattern that I'm looking for a name for: basically "barbies" with a type family where: TF Identity x = x; TF f x = f x
2021-09-11 02:10:19 +0200 <lechner> actually, may it does not work so well. i get lexical error in string/character literal at character 't'
2021-09-11 02:11:23 +0200 <monochrom> OptimizedTypeLevelApplication
2021-09-11 02:11:30 +0200 <geekosaur> @where paste
2021-09-11 02:11:30 +0200 <lambdabot> Help us help you: please paste full code, input and/or output at e.g. https://paste.tomsmeding.com
2021-09-11 02:13:06 +0200 <lechner> https://paste.tomsmeding.com/Ld3L3FeP
2021-09-11 02:13:46 +0200 <geekosaur> you need the closing backslash too
2021-09-11 02:13:53 +0200 <lechner> ah
2021-09-11 02:14:14 +0200 <lechner> thanks! did i mention i am a newbie?
2021-09-11 02:15:33 +0200amitnjha(~amit@024-216-124-116.res.spectrum.com) (Quit: amitnjha)
2021-09-11 02:15:46 +0200amitnjha(~amit@024-216-124-116.res.spectrum.com)
2021-09-11 02:16:15 +0200vicfred(~vicfred@user/vicfred) (Quit: Leaving)
2021-09-11 02:18:22 +0200 <lechner> Hi, what the right way to render HTML entities in Lucid please?
2021-09-11 02:21:04 +0200 <lechner> HTML entities are escaped, and UTF-8 in the literal string is not encoded
2021-09-11 02:24:28 +0200 <hololeap> Could not deduce (MonadFail m) arising from a do statement with the failable pattern
2021-09-11 02:24:41 +0200 <hololeap> I've never seen this before. any ideas where it's coming from?
2021-09-11 02:25:34 +0200 <geekosaur> you have a do with a pattern match in it, which induces a MonadFail constraint which can't be fulfilled
2021-09-11 02:25:35 +0200 <awpr> hololeap: pattern on the LHS of an <- that doesn't cover all constructors of the type
2021-09-11 02:25:40 +0200 <geekosaur> @where paste
2021-09-11 02:25:40 +0200 <lambdabot> Help us help you: please paste full code, input and/or output at e.g. https://paste.tomsmeding.com
2021-09-11 02:26:18 +0200 <hololeap> awpr: huh ok, thanks
2021-09-11 02:30:22 +0200dajoer(~david@user/gvx)
2021-09-11 02:30:53 +0200amitnjha(~amit@024-216-124-116.res.spectrum.com) (Quit: amitnjha)
2021-09-11 02:31:08 +0200amitnjha(~amit@024-216-124-116.res.spectrum.com)
2021-09-11 02:32:44 +0200 <hololeap> are there any downsides to using :+: from GHC.Generics as opposed to Data.Functor.Compose ?
2021-09-11 02:32:47 +0200neurocyte(~neurocyte@user/neurocyte) (Ping timeout: 252 seconds)
2021-09-11 02:33:52 +0200 <glguy> You mean :.: ?
2021-09-11 02:36:08 +0200 <hololeap> yeah
2021-09-11 02:36:29 +0200 <hololeap> but I guess the same question could apply to :+: and Data.Functor.Sum
2021-09-11 02:36:35 +0200 <glguy> If so the differences would be Compose and :.: happen to have different class instances, and you'll confuse your reader using :.: but not actually doing anything with Generic1; on the other hand an advantage of :.: is that it's poly kinded
2021-09-11 02:36:58 +0200 <glguy> oh, nevermind, they both are
2021-09-11 02:40:15 +0200gioyik(~gioyik@gateway/tor-sasl/gioyik) (Quit: WeeChat 3.1)
2021-09-11 02:40:55 +0200neurocyte(~neurocyte@195.80.55.123)
2021-09-11 02:40:55 +0200neurocyte(~neurocyte@195.80.55.123) (Changing host)
2021-09-11 02:40:55 +0200neurocyte(~neurocyte@user/neurocyte)
2021-09-11 02:55:43 +0200beka(~beka@104.193.170.240) (Read error: Connection reset by peer)
2021-09-11 02:57:22 +0200Zianic(~12602@user/zianic) (Ping timeout: 250 seconds)
2021-09-11 03:13:38 +0200harveypwca(~harveypwc@2601:246:c180:a570:2435:ba7:e573:bc26) (Quit: Leaving)
2021-09-11 03:21:10 +0200xff0x(~xff0x@2001:1a81:531e:3c00:25c1:193a:5cc2:a16c) (Ping timeout: 260 seconds)
2021-09-11 03:22:47 +0200xff0x(~xff0x@2001:1a81:5337:500:e9c5:4ba0:f0a1:a088)
2021-09-11 03:24:45 +0200merijn(~merijn@83-160-49-249.ip.xs4all.nl)
2021-09-11 03:30:05 +0200merijn(~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 265 seconds)
2021-09-11 03:32:01 +0200neurocyte1(~neurocyte@94.46.86.84)
2021-09-11 03:32:01 +0200neurocyte1(~neurocyte@94.46.86.84) (Changing host)
2021-09-11 03:32:01 +0200neurocyte1(~neurocyte@user/neurocyte)
2021-09-11 03:34:34 +0200neurocyte(~neurocyte@user/neurocyte) (Ping timeout: 260 seconds)
2021-09-11 03:34:34 +0200neurocyte1neurocyte
2021-09-11 03:37:01 +0200unit73e(~emanuel@2001:818:e8dd:7c00:32b5:c2ff:fe6b:5291) (Remote host closed the connection)
2021-09-11 03:42:45 +0200raehik(~raehik@cpc95906-rdng25-2-0-cust156.15-3.cable.virginm.net) (Ping timeout: 260 seconds)
2021-09-11 03:43:27 +0200abhixec(~abhixec@c-67-169-139-16.hsd1.ca.comcast.net)
2021-09-11 03:46:14 +0200amitnjha(~amit@024-216-124-116.res.spectrum.com) (Quit: amitnjha)
2021-09-11 03:46:27 +0200amitnjha(~amit@024-216-124-116.res.spectrum.com)
2021-09-11 03:56:40 +0200amitnjha(~amit@024-216-124-116.res.spectrum.com) (Quit: amitnjha)
2021-09-11 03:56:55 +0200amitnjha(~amit@024-216-124-116.res.spectrum.com)
2021-09-11 04:00:31 +0200benin03693230(~benin@183.82.24.227)
2021-09-11 04:01:21 +0200lavaman(~lavaman@98.38.249.169)
2021-09-11 04:02:28 +0200benin0369323(~benin@183.82.24.241) (Ping timeout: 252 seconds)
2021-09-11 04:02:29 +0200benin03693230benin0369323
2021-09-11 04:05:50 +0200lavaman(~lavaman@98.38.249.169) (Ping timeout: 260 seconds)
2021-09-11 04:07:25 +0200martin02(~silas@141.84.69.76) (Ping timeout: 252 seconds)
2021-09-11 04:10:45 +0200vysn(~vysn@user/vysn)
2021-09-11 04:12:01 +0200amitnjha(~amit@024-216-124-116.res.spectrum.com) (Quit: amitnjha)
2021-09-11 04:12:18 +0200amitnjha(~amit@024-216-124-116.res.spectrum.com)
2021-09-11 04:12:50 +0200aegon(~mike@174.127.249.180) (Remote host closed the connection)
2021-09-11 04:12:50 +0200td_(~td@94.134.91.202) (Ping timeout: 260 seconds)
2021-09-11 04:14:18 +0200martin02(~silas@141.84.69.76)
2021-09-11 04:14:44 +0200td_(~td@94.134.91.99)
2021-09-11 04:20:50 +0200geekosaur(~geekosaur@xmonad/geekosaur) (Killed (NickServ (GHOST command used by allbery_b)))
2021-09-11 04:20:53 +0200allbery_b(~geekosaur@xmonad/geekosaur)
2021-09-11 04:20:56 +0200allbery_bgeekosaur
2021-09-11 04:26:09 +0200geekosaur(~geekosaur@xmonad/geekosaur) (Ping timeout: 265 seconds)
2021-09-11 04:26:19 +0200bzm3r(~bzm3r@d50-92-75-230.bchsia.telus.net)
2021-09-11 04:29:06 +0200bzm3r(~bzm3r@d50-92-75-230.bchsia.telus.net) (Client Quit)
2021-09-11 04:32:24 +0200amitnjha(~amit@024-216-124-116.res.spectrum.com) (Quit: amitnjha)
2021-09-11 04:32:48 +0200amitnjha(~amit@024-216-124-116.res.spectrum.com)
2021-09-11 04:32:50 +0200[itchyjunk](~itchyjunk@user/itchyjunk/x-7353470) (Read error: Connection reset by peer)
2021-09-11 04:35:28 +0200alx741(~alx741@186.178.109.89) (Ping timeout: 252 seconds)
2021-09-11 04:36:04 +0200alx741(~alx741@186.178.109.89)
2021-09-11 04:36:56 +0200alx741(~alx741@186.178.109.89) (Client Quit)
2021-09-11 04:37:51 +0200amitnjha(~amit@024-216-124-116.res.spectrum.com) (Quit: amitnjha)
2021-09-11 04:38:05 +0200amitnjha(~amit@024-216-124-116.res.spectrum.com)
2021-09-11 04:43:11 +0200amitnjha(~amit@024-216-124-116.res.spectrum.com) (Quit: amitnjha)
2021-09-11 04:43:28 +0200amitnjha(~amit@024-216-124-116.res.spectrum.com)
2021-09-11 04:48:32 +0200amitnjha(~amit@024-216-124-116.res.spectrum.com) (Quit: amitnjha)
2021-09-11 04:48:51 +0200amitnjha(~amit@024-216-124-116.res.spectrum.com)
2021-09-11 04:55:48 +0200benin03693230(~benin@183.82.24.227)
2021-09-11 04:59:02 +0200benin0369323(~benin@183.82.24.227) (Ping timeout: 260 seconds)
2021-09-11 05:01:52 +0200FinnElija(~finn_elij@user/finn-elija/x-0085643) (Ping timeout: 252 seconds)
2021-09-11 05:02:09 +0200machinedgod(~machinedg@24.105.81.50)
2021-09-11 05:03:49 +0200FinnElija(~finn_elij@user/finn-elija/x-0085643)
2021-09-11 05:03:52 +0200amitnjha(~amit@024-216-124-116.res.spectrum.com) (Quit: amitnjha)
2021-09-11 05:04:06 +0200amitnjha(~amit@024-216-124-116.res.spectrum.com)
2021-09-11 05:09:12 +0200amitnjha(~amit@024-216-124-116.res.spectrum.com) (Quit: amitnjha)
2021-09-11 05:09:26 +0200amitnjha(~amit@024-216-124-116.res.spectrum.com)
2021-09-11 05:19:19 +0200abhixec(~abhixec@c-67-169-139-16.hsd1.ca.comcast.net) (Ping timeout: 252 seconds)
2021-09-11 05:24:32 +0200amitnjha(~amit@024-216-124-116.res.spectrum.com) (Quit: amitnjha)
2021-09-11 05:24:53 +0200amitnjha(~amit@024-216-124-116.res.spectrum.com)
2021-09-11 05:26:06 +0200waleee(~waleee@2001:9b0:216:8200:d457:9189:7843:1dbd) (Ping timeout: 260 seconds)
2021-09-11 05:26:31 +0200merijn(~merijn@83-160-49-249.ip.xs4all.nl)
2021-09-11 05:31:24 +0200merijn(~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 265 seconds)
2021-09-11 05:42:45 +0200asivitz(uid178348@id-178348.tinside.irccloud.com) (Quit: Connection closed for inactivity)
2021-09-11 05:49:17 +0200texasmynsted(~texasmyns@99.96.221.112) (WeeChat 3.1)
2021-09-11 05:51:46 +0200machinedgod(~machinedg@24.105.81.50) (Ping timeout: 260 seconds)
2021-09-11 06:04:26 +0200nicbk(~nicbk@user/nicbk)
2021-09-11 06:09:52 +0200jjess
2021-09-11 06:21:21 +0200 <jle`> remember when we used to write (Applicative m, Monad m) => ..
2021-09-11 06:37:50 +0200nattiestnate(~nate@2001:448a:20a0:4134:25e:715f:d637:5263)
2021-09-11 06:44:00 +0200beaky(~beaky@2a03:b0c0:0:1010::1e:a001) (Quit: WeeChat 3.2)
2021-09-11 06:44:09 +0200beaky(~beaky@2a03:b0c0:0:1010::1e:a001)
2021-09-11 07:01:29 +0200 <iqubic> Nope!
2021-09-11 07:01:42 +0200 <iqubic> I only started using Haskell 5 years ago.
2021-09-11 07:02:37 +0200 <hololeap> @hoogle Monad m => (a -> m b) -> t a -> m (t b)
2021-09-11 07:02:38 +0200 <lambdabot> Prelude mapM :: (Traversable t, Monad m) => (a -> m b) -> t a -> m (t b)
2021-09-11 07:02:38 +0200 <lambdabot> Control.Monad mapM :: (Traversable t, Monad m) => (a -> m b) -> t a -> m (t b)
2021-09-11 07:02:38 +0200 <lambdabot> Data.Traversable mapM :: (Traversable t, Monad m) => (a -> m b) -> t a -> m (t b)
2021-09-11 07:03:10 +0200benin03693230(~benin@183.82.24.227) (Ping timeout: 260 seconds)
2021-09-11 07:03:23 +0200 <hololeap> is there a typeclass like Traversable but requiring Monad instead of Applicative on the `traverse` function?
2021-09-11 07:05:42 +0200 <hololeap> also, hoogle.haskell.org is down
2021-09-11 07:05:51 +0200takuan(~takuan@178-116-218-225.access.telenet.be)
2021-09-11 07:05:59 +0200 <hololeap> (no space left on device)
2021-09-11 07:07:22 +0200mikoto-chan(~mikoto-ch@83.137.2.248) (Quit: mikoto-chan)
2021-09-11 07:08:23 +0200vk3wtf_(~doc@194-193-188-29.tpgi.com.au)
2021-09-11 07:09:12 +0200 <monochrom> @type mapM_
2021-09-11 07:09:13 +0200 <lambdabot> (Foldable t, Monad m) => (a -> m b) -> t a -> m ()
2021-09-11 07:09:22 +0200 <monochrom> @type mapM
2021-09-11 07:09:23 +0200 <lambdabot> (Traversable t, Monad m) => (a -> m b) -> t a -> m (t b)
2021-09-11 07:09:43 +0200 <monochrom> That one still requires Monad and does what traverse does.
2021-09-11 07:10:40 +0200vk3wtf(~doc@220-245-2-190.tpgi.com.au) (Ping timeout: 240 seconds)
2021-09-11 07:11:51 +0200 <awpr> the extra flexibility those monad-traversals would have is that they can have earlier elements' results affect later elements' inputs. I've never really come up with a sensible thing of that type that isn't just a normal Traversal
2021-09-11 07:12:51 +0200 <awpr> I've implicitly adjusted the question to "what do you get if you put `Monad` instead of `Applicative` in the definition of `Traversal`"
2021-09-11 07:14:10 +0200 <jle`> awpr: you can do that with StateT at least
2021-09-11 07:14:19 +0200 <jle`> oh, i misread
2021-09-11 07:14:53 +0200 <jle`> earlier elements' results affect the actions of later inputs, yeah, i think needs Monad
2021-09-11 07:15:42 +0200neo2(~neo3@cpe-292712.ip.primehome.com)
2021-09-11 07:19:44 +0200 <hololeap> monochrom: what I mean is there is no way to write `traverse` for this particular type, only `mapM` ... so it needs something different from Traversable
2021-09-11 07:20:42 +0200 <awpr> what's the type? it must be pretty exotic to need `Monad` in its traversal-like thing
2021-09-11 07:23:53 +0200 <hololeap> awpr: data Node f a b = Node a (HashMap Name (f b)) ; newtype MyTree f a = MyTree (Fix (Node f a))
2021-09-11 07:24:08 +0200 <jle`> sounds like something that may not necessarily follow the Traversable laws anyway
2021-09-11 07:24:39 +0200 <jle`> hololeap: what's the type you watn to write "traverse" for?
2021-09-11 07:24:46 +0200 <hololeap> MyTree
2021-09-11 07:25:10 +0200 <jle`> traverse :: (a -> m b) -> MyTree f a -> m (MyTree f b) ?
2021-09-11 07:25:34 +0200 <jle`> any constraints on f or m?
2021-09-11 07:25:54 +0200 <awpr> I don't immediately see why that would not support Traversable. it'd need `Traversable f`, but I don't think it'd need `Monad`
2021-09-11 07:26:27 +0200 <hololeap> f needs to be Traversable... I haven't found a way to write it for m being Applicative, only when m is Monad
2021-09-11 07:27:40 +0200 <jle`> ah, so it's not necesarily a theoretical thing like you *need* to have actions depend on previous reuslts ... it's that you aren't sure how to implement it ?
2021-09-11 07:28:28 +0200 <hololeap> right
2021-09-11 07:30:28 +0200 <hololeap> my implementation of Functor for MyTree uses hoistFix, and Foldable uses foldFix... I think Traversable would need (possibly) foldFixM which has a Monad constraint
2021-09-11 07:30:38 +0200 <hololeap> https://hackage.haskell.org/package/data-fix-0.3.2/docs/Data-Fix.html#v:foldFixM
2021-09-11 07:31:27 +0200 <hololeap> I tried writing: (Traversable g, Applicative m) => (forall a. f a -> m (g a)) -> Fix f -> m (Fix g)
2021-09-11 07:31:33 +0200 <hololeap> as a new function
2021-09-11 07:31:53 +0200 <hololeap> but I got stuck and the only way to proceed was to change "Applicatve m" to "Monad m"
2021-09-11 07:32:47 +0200 <hololeap> so I'm starting to suspect it isn't possible to write `traverse` because of the Applicative constraint
2021-09-11 07:33:35 +0200hays(rootvegeta@fsf/member/hays) (Quit: hays)
2021-09-11 07:34:59 +0200amitnjha(~amit@024-216-124-116.res.spectrum.com) (Quit: amitnjha)
2021-09-11 07:35:18 +0200amitnjha(~amit@024-216-124-116.res.spectrum.com)
2021-09-11 07:35:43 +0200hays(rootvegeta@fsf/member/hays)
2021-09-11 07:35:46 +0200oxide(~lambda@user/oxide)
2021-09-11 07:40:22 +0200amitnjha(~amit@024-216-124-116.res.spectrum.com) (Quit: amitnjha)
2021-09-11 07:40:25 +0200haskl[error](~haskl@user/haskl)
2021-09-11 07:40:26 +0200haskl(~haskl@user/haskl) (Ping timeout: 256 seconds)
2021-09-11 07:40:36 +0200amitnjha(~amit@024-216-124-116.res.spectrum.com)
2021-09-11 07:43:12 +0200 <awpr> wrote one
2021-09-11 07:44:29 +0200 <awpr> it's pretty straightforward/mechanical to write a bitraverse function for `Node`, and then with some kinda tricky recursion you can thread that through the tree to get a traverse for `MyTree`
2021-09-11 07:44:53 +0200 <hololeap> ok, I actually have bitraverse for Node written
2021-09-11 07:46:03 +0200slowButPresent(~slowButPr@user/slowbutpresent) (Quit: leaving)
2021-09-11 07:47:30 +0200 <hololeap> awpr: would you mind sharing what you wrote?
2021-09-11 07:49:11 +0200Cajun(~Cajun@user/cajun)
2021-09-11 07:49:33 +0200 <awpr> `go (Fix node) = Fix <$> bitraverseNode f go node` is the core part of it
2021-09-11 07:54:18 +0200 <hololeap> awpr: awesome, it works!
2021-09-11 08:00:30 +0200 <awpr> I think you're right that that other type signature requires Monad. I haven't figured out a way to factor the recursion out of this implementation, but it seems like it should be possible
2021-09-11 08:03:05 +0200lavaman(~lavaman@98.38.249.169)
2021-09-11 08:05:42 +0200amitnjha(~amit@024-216-124-116.res.spectrum.com) (Quit: amitnjha)
2021-09-11 08:05:56 +0200amitnjha(~amit@024-216-124-116.res.spectrum.com)
2021-09-11 08:07:06 +0200zaquest(~notzaques@5.128.210.178) (Ping timeout: 260 seconds)
2021-09-11 08:07:37 +0200lavaman(~lavaman@98.38.249.169) (Ping timeout: 252 seconds)
2021-09-11 08:08:58 +0200wroathe(~wroathe@user/wroathe) (Ping timeout: 265 seconds)
2021-09-11 08:21:31 +0200falafel(~falafel@2603-8000-d801-2d68-1d6d-bf72-eba2-a20e.res6.spectrum.com)
2021-09-11 08:22:02 +0200xff0x(~xff0x@2001:1a81:5337:500:e9c5:4ba0:f0a1:a088) (Ping timeout: 260 seconds)
2021-09-11 08:22:56 +0200xff0x(~xff0x@2001:1a81:5337:500:915:acb5:b793:8885)
2021-09-11 08:25:56 +0200wroathe(~wroathe@c-68-54-25-135.hsd1.mn.comcast.net)
2021-09-11 08:25:57 +0200wroathe(~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Changing host)
2021-09-11 08:25:57 +0200wroathe(~wroathe@user/wroathe)
2021-09-11 08:27:06 +0200seeg(~thelounge@static.89.161.217.95.clients.your-server.de) (Quit: The Lounge - https://thelounge.chat)
2021-09-11 08:27:48 +0200seeg(~thelounge@static.89.161.217.95.clients.your-server.de)
2021-09-11 08:28:06 +0200nicbk(~nicbk@user/nicbk) (Ping timeout: 276 seconds)
2021-09-11 08:29:37 +0200 <hololeap> awpr: I think this is about as abstract as it gets: http://sprunge.us/HUBf35
2021-09-11 08:30:10 +0200Lycurgus(~juan@98.4.112.204)
2021-09-11 08:30:21 +0200oxide(~lambda@user/oxide) (Quit: oxide)
2021-09-11 08:30:43 +0200wroathe(~wroathe@user/wroathe) (Ping timeout: 265 seconds)
2021-09-11 09:01:06 +0200 <iqubic> Should I switch from Haskell to Idris?
2021-09-11 09:03:27 +0200 <Lycurgus> y u only ax in the old black?
2021-09-11 09:04:13 +0200 <Lycurgus> should also be in #idris, with same query
2021-09-11 09:04:32 +0200brandonh(~brandonh@151.82.94.194)
2021-09-11 09:06:02 +0200amitnjha(~amit@024-216-124-116.res.spectrum.com) (Quit: amitnjha)
2021-09-11 09:06:19 +0200amitnjha(~amit@024-216-124-116.res.spectrum.com)
2021-09-11 09:08:51 +0200tinwood(~tinwood@canonical/tinwood) (Remote host closed the connection)
2021-09-11 09:10:59 +0200zaquest(~notzaques@5.128.210.178)
2021-09-11 09:11:55 +0200tinwood(~tinwood@general.default.akavanagh.uk0.bigv.io)
2021-09-11 09:11:56 +0200tinwood(~tinwood@general.default.akavanagh.uk0.bigv.io) (Changing host)
2021-09-11 09:11:56 +0200tinwood(~tinwood@canonical/tinwood)
2021-09-11 09:13:41 +0200brandonh(~brandonh@151.82.94.194) (Quit: brandonh)
2021-09-11 09:15:47 +0200Lycurgus(~juan@98.4.112.204) (Quit: Exeunt)
2021-09-11 09:16:25 +0200amitnjha(~amit@024-216-124-116.res.spectrum.com) (Quit: amitnjha)
2021-09-11 09:16:39 +0200amitnjha(~amit@024-216-124-116.res.spectrum.com)
2021-09-11 09:16:55 +0200Erutuon(~Erutuon@user/erutuon) (Ping timeout: 252 seconds)
2021-09-11 09:20:42 +0200Brumaire(~quassel@81-64-14-121.rev.numericable.fr)
2021-09-11 09:25:36 +0200acidjnk_new(~acidjnk@p200300d0c72030496808eef6383dbff4.dip0.t-ipconnect.de)
2021-09-11 09:26:45 +0200amitnjha(~amit@024-216-124-116.res.spectrum.com) (Quit: amitnjha)
2021-09-11 09:26:59 +0200amitnjha(~amit@024-216-124-116.res.spectrum.com)
2021-09-11 09:32:05 +0200amitnjha(~amit@024-216-124-116.res.spectrum.com) (Quit: amitnjha)
2021-09-11 09:32:19 +0200amitnjha(~amit@024-216-124-116.res.spectrum.com)
2021-09-11 09:37:38 +0200falafel(~falafel@2603-8000-d801-2d68-1d6d-bf72-eba2-a20e.res6.spectrum.com) (Ping timeout: 260 seconds)
2021-09-11 09:40:26 +0200jinsun(~quassel@user/jinsun) (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.)
2021-09-11 09:40:50 +0200jinsun(~quassel@user/jinsun)
2021-09-11 09:42:25 +0200amitnjha(~amit@024-216-124-116.res.spectrum.com) (Quit: amitnjha)
2021-09-11 09:42:38 +0200amitnjha(~amit@024-216-124-116.res.spectrum.com)
2021-09-11 09:42:38 +0200amitnjha(~amit@024-216-124-116.res.spectrum.com) (Client Quit)
2021-09-11 09:42:46 +0200amitnjha(~amit@024-216-124-116.res.spectrum.com)
2021-09-11 09:42:48 +0200amitnjha(~amit@024-216-124-116.res.spectrum.com) (Client Quit)
2021-09-11 09:43:04 +0200amitnjha(~amit@024-216-124-116.res.spectrum.com)
2021-09-11 09:50:44 +0200max22-(~maxime@2a01cb088335980070405fe723f8a657.ipv6.abo.wanadoo.fr)
2021-09-11 09:54:09 +0200falafel(~falafel@2603-8000-d801-2d68-1d6d-bf72-eba2-a20e.res6.spectrum.com)
2021-09-11 09:54:29 +0200acidjnk_new3(~acidjnk@p200300d0c72030494d60b877161c39dc.dip0.t-ipconnect.de)
2021-09-11 09:56:26 +0200_ht(~quassel@82-169-194-8.biz.kpn.net)
2021-09-11 09:57:08 +0200wonko(~wjc@62.115.229.50)
2021-09-11 09:57:58 +0200falafel_(~falafel@2603-8000-d801-2d68-1d6d-bf72-eba2-a20e.res6.spectrum.com)
2021-09-11 09:58:10 +0200amitnjha(~amit@024-216-124-116.res.spectrum.com) (Quit: amitnjha)
2021-09-11 09:58:19 +0200acidjnk_new(~acidjnk@p200300d0c72030496808eef6383dbff4.dip0.t-ipconnect.de) (Ping timeout: 252 seconds)
2021-09-11 09:58:23 +0200amitnjha(~amit@024-216-124-116.res.spectrum.com)
2021-09-11 10:00:02 +0200falafel__(~falafel@cpe-76-168-195-162.socal.res.rr.com)
2021-09-11 10:00:42 +0200chomwitt(~chomwitt@ppp-94-67-221-96.home.otenet.gr)
2021-09-11 10:01:26 +0200falafel(~falafel@2603-8000-d801-2d68-1d6d-bf72-eba2-a20e.res6.spectrum.com) (Ping timeout: 260 seconds)
2021-09-11 10:02:20 +0200Tuplanolla(~Tuplanoll@91-159-69-50.elisa-laajakaista.fi)
2021-09-11 10:03:16 +0200falafel_(~falafel@2603-8000-d801-2d68-1d6d-bf72-eba2-a20e.res6.spectrum.com) (Ping timeout: 252 seconds)
2021-09-11 10:03:40 +0200cheater(~Username@user/cheater) (Ping timeout: 252 seconds)
2021-09-11 10:04:00 +0200cheater(~Username@user/cheater)
2021-09-11 10:06:20 +0200hendursa1(~weechat@user/hendursaga)
2021-09-11 10:08:51 +0200hendursaga(~weechat@user/hendursaga) (Ping timeout: 276 seconds)
2021-09-11 10:12:35 +0200abraham(~abraham@143.244.185.86) (Quit: The Lounge - https://thelounge.chat)
2021-09-11 10:13:48 +0200abraham(~abraham@143.244.185.86)
2021-09-11 10:15:13 +0200falafel__(~falafel@cpe-76-168-195-162.socal.res.rr.com) (Ping timeout: 252 seconds)
2021-09-11 10:15:36 +0200eggplantade(~Eggplanta@2600:1700:bef1:5e10:c09c:3e60:e691:1fba) (Remote host closed the connection)
2021-09-11 10:18:30 +0200amitnjha(~amit@024-216-124-116.res.spectrum.com) (Quit: amitnjha)
2021-09-11 10:18:49 +0200amitnjha(~amit@024-216-124-116.res.spectrum.com)
2021-09-11 10:19:37 +0200 <jle`> iqubic: depends on what you want to do probably
2021-09-11 10:20:05 +0200Gurkenglas(~Gurkengla@dslb-002-207-014-195.002.207.pools.vodafone-ip.de)
2021-09-11 10:26:10 +0200Gurkenglas(~Gurkengla@dslb-002-207-014-195.002.207.pools.vodafone-ip.de) (Ping timeout: 260 seconds)
2021-09-11 10:31:13 +0200ephemient(uid407513@id-407513.lymington.irccloud.com) (Quit: Connection closed for inactivity)
2021-09-11 10:31:20 +0200gehmehgeh(~user@user/gehmehgeh)
2021-09-11 10:33:50 +0200amitnjha(~amit@024-216-124-116.res.spectrum.com) (Quit: amitnjha)
2021-09-11 10:34:12 +0200amitnjha(~amit@024-216-124-116.res.spectrum.com)
2021-09-11 10:34:17 +0200amitnjha(~amit@024-216-124-116.res.spectrum.com) (Client Quit)
2021-09-11 10:34:40 +0200amitnjha(~amit@024-216-124-116.res.spectrum.com)
2021-09-11 10:34:42 +0200random-jellyfish(~random-je@user/random-jellyfish)
2021-09-11 10:37:34 +0200ephemient(uid407513@id-407513.lymington.irccloud.com)
2021-09-11 10:39:34 +0200martin02(~silas@141.84.69.76) (Ping timeout: 252 seconds)
2021-09-11 10:39:44 +0200amitnjha(~amit@024-216-124-116.res.spectrum.com) (Quit: amitnjha)
2021-09-11 10:39:58 +0200amitnjha(~amit@024-216-124-116.res.spectrum.com)
2021-09-11 10:40:20 +0200 <Unhammer> Tried https://www.reddit.com/r/haskell/comments/plmrky/ann_vectorhashtables/ on a task I saw somewhere about doing frequency lists `awk '{for(i=1;i<=NF;i++)c[tolower($i)]++} END{for(w in c)print c[w],w}' bigtextfiles.txt`
2021-09-11 10:40:24 +0200 <Unhammer> it's better than unordered-containers HashMap.Strict but I wonder if I'm doing something very wrong since it's quite a bit slower than awk
2021-09-11 10:41:05 +0200 <Unhammer> Compared to unordered-containers HashMap, wall times are going from 4s→2.5s and CPU from 6.5s→3.5s (HashMap is doing more GC? Or is it because I'm using streamly) on a word list of 6200000 unique words
2021-09-11 10:41:18 +0200 <Unhammer> while on a bigger corpus of real text it's like 34s→29s. But GNU awk uses <7s.
2021-09-11 10:41:25 +0200 <Unhammer> https://github.com/unhammer/foo-vh-count
2021-09-11 10:46:11 +0200martin02(~silas@141.84.69.76)
2021-09-11 10:50:08 +0200tzh(~tzh@c-24-21-73-154.hsd1.wa.comcast.net) (Quit: zzz)
2021-09-11 10:50:29 +0200hnOsmium0001(uid453710@id-453710.stonehaven.irccloud.com) (Quit: Connection closed for inactivity)
2021-09-11 10:52:28 +0200econo(uid147250@user/econo) (Quit: Connection closed for inactivity)
2021-09-11 10:59:06 +0200chomwitt(~chomwitt@ppp-94-67-221-96.home.otenet.gr) (Ping timeout: 265 seconds)
2021-09-11 11:00:08 +0200adziahel[m](~adziahelm@2001:470:69fc:105::b4d) (Quit: You have been kicked for being idle)
2021-09-11 11:02:27 +0200random-jellyfish(~random-je@user/random-jellyfish) (Quit: Client closed)
2021-09-11 11:03:54 +0200kstuart(~kstuart@85.203.46.113)
2021-09-11 11:05:04 +0200amitnjha(~amit@024-216-124-116.res.spectrum.com) (Quit: amitnjha)
2021-09-11 11:05:06 +0200TranquilEcho(~grom@user/tranquilecho)
2021-09-11 11:05:26 +0200amitnjha(~amit@024-216-124-116.res.spectrum.com)
2021-09-11 11:05:37 +0200spruit11_(~quassel@2a02:a467:ccd6:1:5542:2068:efaa:d531) (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.)
2021-09-11 11:05:59 +0200spruit11(~quassel@2a02:a467:ccd6:1:5542:2068:efaa:d531)
2021-09-11 11:08:10 +0200 <ldlework> Wow I finally made it through chapter 12 of HFFP
2021-09-11 11:08:16 +0200 <ldlework> what a slog!
2021-09-11 11:10:13 +0200 <Rembane> \o/
2021-09-11 11:13:45 +0200 <adamse> Unhammer: maybe gc? try running with +RTS -s to see some stats about where the time is spent
2021-09-11 11:15:31 +0200amitnjha(~amit@024-216-124-116.res.spectrum.com) (Quit: amitnjha)
2021-09-11 11:15:51 +0200amitnjha(~amit@024-216-124-116.res.spectrum.com)
2021-09-11 11:16:01 +0200eggplantade(~Eggplanta@2600:1700:bef1:5e10:c09c:3e60:e691:1fba)
2021-09-11 11:20:27 +0200eggplantade(~Eggplanta@2600:1700:bef1:5e10:c09c:3e60:e691:1fba) (Ping timeout: 245 seconds)
2021-09-11 11:20:44 +0200kstuart(~kstuart@85.203.46.113) (Quit: rcirc on GNU Emacs 28.0.50)
2021-09-11 11:21:17 +0200wonko(~wjc@62.115.229.50) (Ping timeout: 245 seconds)
2021-09-11 11:21:19 +0200 <jchia[m]> With a function `open :: String -> IO Connection` (https://hackage.haskell.org/package/sqlite-simple-0.4.18.0/docs/Database-SQLite-Simple.html#v:open), can I get the GHC runtime to call `close :: Connection -> IO ()` when the Connection has no more references to it, e.g. when it is is being GC'ed? This way I don't have to explicitly call close myself.
2021-09-11 11:22:19 +0200 <Unhammer> http://sprunge.us/v3rIja adamse lots of time spent gc-ing there, yeah
2021-09-11 11:22:28 +0200 <Unhammer> 25% productive
2021-09-11 11:22:40 +0200kstuart(~kstuart@85.203.46.113)
2021-09-11 11:24:32 +0200 <Unhammer> I guess awk can allocate one area to put current line in and nearly never change that while my haskell thing is probably allocating for every string it reads
2021-09-11 11:25:26 +0200 <Cale> jchia[m]: Not super-easily. It might be possible to hook up something involving ForeignPtr... if you're willing to edit the direct-sqlite3 package to use a ForeignPtr rather than a Ptr in the implementation of Database (which is reflected as Connection by this library)
2021-09-11 11:25:50 +0200 <maerwald> GC hooks?
2021-09-11 11:27:28 +0200 <jchia[m]> @Cale I'm not sure what to do with the FunPtr (https://hackage.haskell.org/package/base-4.15.0.0/docs/Foreign-Ptr.html#t:FunPtr). It seems rather complicated.
2021-09-11 11:27:28 +0200 <lambdabot> Unknown command, try @list
2021-09-11 11:27:34 +0200cafkafk(~cafkafk@user/cafkafk)
2021-09-11 11:27:46 +0200 <Cale> Which FunPtr?
2021-09-11 11:28:17 +0200 <Cale> I'm referring to this type: https://hackage.haskell.org/package/base-4.15.0.0/docs/Foreign-ForeignPtr.html#t:ForeignPtr
2021-09-11 11:28:46 +0200 <jchia[m]> https://hackage.haskell.org/package/base-4.15.0.0/docs/Foreign-Ptr.html#t:FunPtr https://hackage.haskell.org/package/base-4.15.0.0/docs/Foreign-Ptr.html#t:FunPtr
2021-09-11 11:29:07 +0200 <maerwald> jchia[m]: https://github.com/composewell/streamly/blob/263da09804f3c45d40a8b17e030c1a5850d5b909/src/Streamly…
2021-09-11 11:29:07 +0200kuribas(~user@ptr-25vy0i92albk3w04mlr.18120a2.ip6.access.telenet.be)
2021-09-11 11:29:10 +0200 <maerwald> does that help maybe?
2021-09-11 11:29:14 +0200 <Cale> Do you mean the FunPtr to the finalizer?
2021-09-11 11:29:35 +0200 <jchia[m]> newForeignPtr requires a FinalizerPtr, which is a type alias for FunPtr
2021-09-11 11:29:41 +0200 <jchia[m]> Yes
2021-09-11 11:31:06 +0200 <adamse> Unhammer: you might want to follow up with some profiling of allocations, maybe you can do lesd
2021-09-11 11:31:08 +0200 <adamse> less
2021-09-11 11:32:53 +0200Sgeo(~Sgeo@user/sgeo) (Read error: Connection reset by peer)
2021-09-11 11:34:34 +0200 <Cale> It's odd that the ForeignPtr library doesn't already export something like this, but you can get a wrapper function that gets you a suitable finalizer pointer for a Haskell function like:
2021-09-11 11:35:41 +0200 <Cale> foreign import ccall "wrapper" mkFinalizer :: (Ptr Database -> IO ()) -> IO (FunPtr (Ptr Database -> IO ()))
2021-09-11 11:36:26 +0200 <Cale> Maybe that can't be polymorphic, I'm not sure.
2021-09-11 11:36:39 +0200 <Cale> Actually, that's probably why?
2021-09-11 11:36:50 +0200 <Unhammer> trying a profiling build, the code is so short I find it hard to find where I'm doing something I don't have to do https://github.com/unhammer/foo-vh-count/blob/master/src/Lib.hs#L29..L41 feeling more like I'm using the wrong libs or something
2021-09-11 11:37:28 +0200 <Cale> Yeah.
2021-09-11 11:38:13 +0200 <Cale> (sorry, that "Yeah" was with respect to my previous message)
2021-09-11 11:41:02 +0200gehmehgeh(~user@user/gehmehgeh) (Quit: Leaving)
2021-09-11 11:45:55 +0200hololeap(~hololeap@user/hololeap) (Remote host closed the connection)
2021-09-11 11:47:18 +0200hololeap(~hololeap@user/hololeap)
2021-09-11 11:48:18 +0200max22-(~maxime@2a01cb088335980070405fe723f8a657.ipv6.abo.wanadoo.fr) (Remote host closed the connection)
2021-09-11 11:49:03 +0200max22-(~maxime@2a01cb0883359800e9777d123123e3c6.ipv6.abo.wanadoo.fr)
2021-09-11 11:55:52 +0200 <Unhammer> ok, so I need to try something other than streamly, 76%alloc there
2021-09-11 11:58:27 +0200gehmehgeh(~user@user/gehmehgeh)
2021-09-11 11:59:51 +0200chomwitt(~chomwitt@2a02:587:dc14:5d00:12c3:7bff:fe6d:d374)
2021-09-11 12:04:47 +0200lavaman(~lavaman@98.38.249.169)
2021-09-11 12:05:54 +0200amitnjha(~amit@024-216-124-116.res.spectrum.com) (Quit: amitnjha)
2021-09-11 12:06:07 +0200amitnjha(~amit@024-216-124-116.res.spectrum.com)
2021-09-11 12:09:40 +0200lavaman(~lavaman@98.38.249.169) (Ping timeout: 265 seconds)
2021-09-11 12:13:03 +0200Brumaire(~quassel@81-64-14-121.rev.numericable.fr) (Ping timeout: 265 seconds)
2021-09-11 12:13:28 +0200 <kuribas> is there a better way than runMaybeT . asum . map (MaybeT . ...) ?
2021-09-11 12:13:50 +0200 <kuribas> foldMapA or something?
2021-09-11 12:16:49 +0200 <kuribas> basically it runs the actions until one gives (Just a)
2021-09-11 12:17:25 +0200eggplantade(~Eggplanta@2600:1700:bef1:5e10:c09c:3e60:e691:1fba)
2021-09-11 12:19:15 +0200 <kuribas> > MaybeT (Identity $ Just 3) <|> MaybeT (Identity $ Just 4)
2021-09-11 12:19:16 +0200 <lambdabot> error:
2021-09-11 12:19:16 +0200 <lambdabot> • Data constructor not in scope:
2021-09-11 12:19:16 +0200 <lambdabot> MaybeT :: Identity (Maybe a0) -> f a
2021-09-11 12:21:33 +0200wolfshappen(~waff@irc.furworks.de) (Quit: later)
2021-09-11 12:21:54 +0200eggplantade(~Eggplanta@2600:1700:bef1:5e10:c09c:3e60:e691:1fba) (Ping timeout: 260 seconds)
2021-09-11 12:24:24 +0200phma(~phma@host-67-44-208-118.hnremote.net) (Read error: Connection reset by peer)
2021-09-11 12:25:30 +0200phma(~phma@host-67-44-208-57.hnremote.net)
2021-09-11 12:27:33 +0200brandonh(~brandonh@151.82.90.222)
2021-09-11 12:29:46 +0200mikoto-chan(~mikoto-ch@ip-83-134-2-136.dsl.scarlet.be)
2021-09-11 12:30:04 +0200 <hololeap> % import Control.Monad.Trans.Maybe
2021-09-11 12:30:05 +0200 <yahb> hololeap:
2021-09-11 12:30:29 +0200 <hololeap> % MaybeT (Identity $ Just 3) <|> MaybeT (Identity $ Just 4)
2021-09-11 12:30:29 +0200 <yahb> hololeap: MaybeT (Identity (Just 3))
2021-09-11 12:30:35 +0200 <hololeap> kuribas: ^
2021-09-11 12:31:09 +0200 <kuribas> thanks :)
2021-09-11 12:31:11 +0200 <hololeap> the Alternative instance returns the first (m (Just a))
2021-09-11 12:31:20 +0200 <kuribas> % MaybeT (Identity $ Nothing) <|> MaybeT (Identity $ Just 4)
2021-09-11 12:31:20 +0200 <yahb> kuribas: MaybeT (Identity (Just 4))
2021-09-11 12:31:37 +0200 <kuribas> which is what I wanted...
2021-09-11 12:32:16 +0200 <hololeap> % import qualified Data.Monoid as M
2021-09-11 12:32:16 +0200 <yahb> hololeap:
2021-09-11 12:32:22 +0200 <hololeap> % :i M.Alt
2021-09-11 12:32:23 +0200 <yahb> hololeap: type role Alt representational nominal; type Alt :: forall {k}. (k -> *) -> k -> *; newtype Alt f a = Alt {getAlt :: f a}; -- Defined in `base-4.15.0.0:Data.Semigroup.Internal'; instance Alternative f => Alternative (Alt f) -- Defined in `base-4.15.0.0:Data.Semigroup.Internal'; instance Applicative f => Applicative (Alt f) -- Defined in `base-4.15.0.0:Data.Semigroup.Internal'; instance forall k (f ::
2021-09-11 12:32:49 +0200 <hololeap> not a good output...
2021-09-11 12:33:19 +0200 <hololeap> but the Alt wrapper lets you use an Alternative as a Monoid, which lets you do mconcat, for instance
2021-09-11 12:33:52 +0200 <kuribas> right
2021-09-11 12:36:29 +0200 <kuribas> That will be a lot of unwrapping...
2021-09-11 12:36:35 +0200 <kuribas> I could use coerce though.
2021-09-11 12:36:42 +0200 <kuribas> coerce $ foldMap (Alt . MaybeT . ($cmd) . getCgiCommand) cmds
2021-09-11 12:37:05 +0200 <hololeap> you can make a newtype and derive Monoid using DerivingVia
2021-09-11 12:37:17 +0200 <kuribas> no, it's just in one place.
2021-09-11 12:37:48 +0200gehmehgeh(~user@user/gehmehgeh) (Quit: Leaving)
2021-09-11 12:39:08 +0200 <hololeap> even if it's in one place, thinking about how your data structures will combine using Semigroup and Monoid might save you a headache in the future
2021-09-11 12:39:55 +0200 <hololeap> everything is monoidal, so it pops up quite a bit
2021-09-11 12:40:34 +0200 <kuribas> I don't have a monoid for this...
2021-09-11 12:40:43 +0200 <kuribas> You just need to give a list of commands.
2021-09-11 12:41:00 +0200 <hololeap> is there an empty list of commands?
2021-09-11 12:41:17 +0200 <kuribas> no, I already have 2 :)
2021-09-11 12:41:26 +0200 <kuribas> there will be more, not less.
2021-09-11 12:41:47 +0200 <hololeap> so minimum of 2?
2021-09-11 12:42:10 +0200 <kuribas> yes
2021-09-11 12:43:31 +0200 <hololeap> then Monoid probably won't be something it can get an instance of, but Semigroup is very powerful on its own. can you imagine a way that two lists of commands would combine? for instance a list that is from the command line, and a list that is the default
2021-09-11 12:44:46 +0200 <kuribas> then I use (++) :)
2021-09-11 12:44:48 +0200gehmehgeh(~user@user/gehmehgeh)
2021-09-11 12:46:59 +0200 <hololeap> well, a list is the definitive monoid
2021-09-11 12:47:24 +0200 <hololeap> so there's your monoid
2021-09-11 12:47:45 +0200 <kuribas> I prefer (++) because it may optimize better sometimes.
2021-09-11 12:48:30 +0200xff0x(~xff0x@2001:1a81:5337:500:915:acb5:b793:8885) (Ping timeout: 260 seconds)
2021-09-11 12:50:35 +0200 <hololeap> I think that (<>) = (++) for lists, so either way works. I'm just a big fan of monoids.
2021-09-11 12:50:41 +0200[itchyjunk](~itchyjunk@user/itchyjunk/x-7353470)
2021-09-11 12:51:56 +0200jakalx(~jakalx@base.jakalx.net) (Error from remote client)
2021-09-11 12:51:59 +0200 <hololeap> every time I start a new piece of code I work out Semigroup or Monoid instances for each type because it helps structure how the program composes
2021-09-11 12:54:24 +0200 <kuribas> hololeap: it *is* equal to (++), but may behave different wrt rewrite rules.
2021-09-11 12:55:14 +0200 <kuribas> foldr/buildr fusion etc...
2021-09-11 12:55:28 +0200 <hololeap> that seems unlikely, but I really don't know. I would think that defining one function as another would get optimized easily by the compiler
2021-09-11 12:56:06 +0200 <hololeap> so that (++) and (<>) are identical
2021-09-11 12:58:51 +0200 <kuribas> rewrite rules don't look at meaning, they just work on literal code fragments.
2021-09-11 12:58:56 +0200 <kuribas> It's what makes them fragile.
2021-09-11 13:00:28 +0200 <hololeap> the semantics and denotation are both identical in the case of (++) and (<>), so I would be disappointed if there wasn't some kind of optimization that made them equivalent in production
2021-09-11 13:00:59 +0200alx741(~alx741@186.178.109.89)
2021-09-11 13:02:32 +0200 <kuribas> foldMap and concatMap aren't equal either
2021-09-11 13:02:49 +0200 <kuribas> hololeap: you give to much credit to the compiler :)
2021-09-11 13:03:03 +0200 <kuribas> ghc is pretty nice in many aspects, but it often misses the boat as well...
2021-09-11 13:04:37 +0200ubert(~Thunderbi@178.165.183.38.wireless.dyn.drei.com)
2021-09-11 13:05:12 +0200raehik(~raehik@cpc95906-rdng25-2-0-cust156.15-3.cable.virginm.net)
2021-09-11 13:09:14 +0200Pickchea(~private@user/pickchea)
2021-09-11 13:10:05 +0200raehik(~raehik@cpc95906-rdng25-2-0-cust156.15-3.cable.virginm.net) (Ping timeout: 265 seconds)
2021-09-11 13:12:05 +0200AlexZenon(~alzenon@178.34.161.122) (Ping timeout: 260 seconds)
2021-09-11 13:12:13 +0200AlexNoo_(~AlexNoo@178.34.151.112)
2021-09-11 13:12:17 +0200AlexZenon(~alzenon@178.34.151.112)
2021-09-11 13:13:28 +0200AlexNoo(~AlexNoo@178.34.161.122) (Ping timeout: 252 seconds)
2021-09-11 13:13:28 +0200Alex_test(~al_test@178.34.161.122) (Ping timeout: 265 seconds)
2021-09-11 13:14:56 +0200raehik(~raehik@cpc95906-rdng25-2-0-cust156.15-3.cable.virginm.net)
2021-09-11 13:17:54 +0200Alex_test(~al_test@178.34.151.112)
2021-09-11 13:18:15 +0200eggplantade(~Eggplanta@2600:1700:bef1:5e10:c09c:3e60:e691:1fba)
2021-09-11 13:18:49 +0200ubert(~Thunderbi@178.165.183.38.wireless.dyn.drei.com) (Read error: Connection reset by peer)
2021-09-11 13:19:06 +0200ubert(~Thunderbi@178.165.183.38.wireless.dyn.drei.com)
2021-09-11 13:19:45 +0200brandonh(~brandonh@151.82.90.222) (Ping timeout: 265 seconds)
2021-09-11 13:19:59 +0200gehmehgeh(~user@user/gehmehgeh) (Quit: Leaving)
2021-09-11 13:20:01 +0200kstuart(~kstuart@85.203.46.113) (Ping timeout: 252 seconds)
2021-09-11 13:21:59 +0200brandonh(brandonh@gateway/vpn/protonvpn/brandonh)
2021-09-11 13:22:34 +0200eggplantade(~Eggplanta@2600:1700:bef1:5e10:c09c:3e60:e691:1fba) (Ping timeout: 260 seconds)
2021-09-11 13:26:05 +0200zebrag(~chris@user/zebrag) (Quit: Konversation terminated!)
2021-09-11 13:29:18 +0200xff0x(~xff0x@2001:1a81:5337:500:915:acb5:b793:8885)
2021-09-11 13:29:51 +0200stiell(~stiell@gateway/tor-sasl/stiell) (Remote host closed the connection)
2021-09-11 13:30:14 +0200stiell(~stiell@gateway/tor-sasl/stiell)
2021-09-11 13:30:38 +0200 <Las[m]> <kuribas> "foldMap and concatMap aren't..." <- "aren't equal" in what sense?
2021-09-11 13:31:29 +0200 <kuribas> Las[m]: rewrite rules.
2021-09-11 13:32:23 +0200 <Las[m]> Makes sense.
2021-09-11 13:32:30 +0200gehmehgeh(~user@user/gehmehgeh)
2021-09-11 13:39:36 +0200 <pavonia> Those Matrix quotes are ridiculous
2021-09-11 13:40:20 +0200jakalx(~jakalx@base.jakalx.net)
2021-09-11 13:41:13 +0200kuribas(~user@ptr-25vy0i92albk3w04mlr.18120a2.ip6.access.telenet.be) (Remote host closed the connection)
2021-09-11 13:42:38 +0200pbrisbin(~patrick@pool-108-16-214-93.phlapa.fios.verizon.net) (Ping timeout: 260 seconds)
2021-09-11 13:45:19 +0200Pickchea(~private@user/pickchea) (Ping timeout: 252 seconds)
2021-09-11 13:45:33 +0200mestre(~mestre@191.177.175.57)
2021-09-11 13:51:14 +0200amitnjha(~amit@024-216-124-116.res.spectrum.com) (Quit: amitnjha)
2021-09-11 13:51:28 +0200amitnjha(~amit@024-216-124-116.res.spectrum.com)
2021-09-11 13:54:11 +0200brandonh(brandonh@gateway/vpn/protonvpn/brandonh) (Quit: brandonh)
2021-09-11 13:57:53 +0200gehmehgeh(~user@user/gehmehgeh) (Quit: Leaving)
2021-09-11 14:01:40 +0200max22-(~maxime@2a01cb0883359800e9777d123123e3c6.ipv6.abo.wanadoo.fr) (Ping timeout: 260 seconds)
2021-09-11 14:01:52 +0200pmk(~user@ppp-94-64-150-206.home.otenet.gr)
2021-09-11 14:04:14 +0200vs^(~vsl@68.101.54.227)
2021-09-11 14:06:03 +0200gehmehgeh(~user@user/gehmehgeh)
2021-09-11 14:08:38 +0200_alexm_(~alexm_@161.8.253.213)
2021-09-11 14:13:31 +0200_alexm_(~alexm_@161.8.253.213) (Read error: Connection reset by peer)
2021-09-11 14:14:22 +0200_alexm__(~alexm_@161.8.253.213)
2021-09-11 14:15:22 +0200_alexm___alexm_
2021-09-11 14:21:31 +0200wolfshappen(~waff@irc.furworks.de)
2021-09-11 14:24:36 +0200_alexm_(~alexm_@161.8.253.213) (Remote host closed the connection)
2021-09-11 14:27:07 +0200wolfshappen(~waff@irc.furworks.de) (Ping timeout: 252 seconds)
2021-09-11 14:27:41 +0200wolfshappen(~waff@irc.furworks.de)
2021-09-11 14:35:11 +0200pretty_dumm_guy(trottel@gateway/vpn/protonvpn/prettydummguy/x-88029655)
2021-09-11 14:35:16 +0200pretty_dumm_guy(trottel@gateway/vpn/protonvpn/prettydummguy/x-88029655) (Client Quit)
2021-09-11 14:36:27 +0200pretty_dumm_guy(trottel@gateway/vpn/protonvpn/prettydummguy/x-88029655)
2021-09-11 14:38:23 +0200Gurkenglas(~Gurkengla@dslb-002-207-014-195.002.207.pools.vodafone-ip.de)
2021-09-11 14:40:54 +0200 <yushyin> pavonia: but this is no longer irc anyway, i was told, since more users here are connected via matrix supposedly
2021-09-11 14:41:15 +0200 <pavonia> What :O
2021-09-11 14:42:28 +0200 <pavonia> Though only a minority has the [m] nick suffix set
2021-09-11 14:44:52 +0200 <yushyin> not a valid indicator, the suffix is not mandatory ;)
2021-09-11 14:47:29 +0200AlexNoo_AlexNoo
2021-09-11 14:48:33 +0200acidjnk_new(~acidjnk@p5487d0ba.dip0.t-ipconnect.de)
2021-09-11 14:51:28 +0200acidjnk_new3(~acidjnk@p200300d0c72030494d60b877161c39dc.dip0.t-ipconnect.de) (Ping timeout: 252 seconds)
2021-09-11 14:53:11 +0200 <yushyin> pavonia: you can check it with /whois, matrix sets the realname to the matrix id e.g. @user:matrix.org
2021-09-11 14:54:00 +0200renzhi(~xp@modemcable070.17-177-173.mc.videotron.ca) (Ping timeout: 265 seconds)
2021-09-11 14:56:25 +0200max22-(~maxime@2a01cb08833598008c4acb2145aa7027.ipv6.abo.wanadoo.fr)
2021-09-11 15:00:18 +0200zebrag(~chris@user/zebrag)
2021-09-11 15:01:00 +0200Lycurgus(~juan@98.4.112.204)
2021-09-11 15:12:27 +0200hendursa1(~weechat@user/hendursaga) (Quit: hendursa1)
2021-09-11 15:12:53 +0200hendursaga(~weechat@user/hendursaga)
2021-09-11 15:16:34 +0200amitnjha(~amit@024-216-124-116.res.spectrum.com) (Quit: amitnjha)
2021-09-11 15:16:50 +0200amitnjha(~amit@024-216-124-116.res.spectrum.com)
2021-09-11 15:20:27 +0200ByronJohnson(~bairyn@mail.digitalkingdom.org) (Ping timeout: 245 seconds)
2021-09-11 15:20:33 +0200kenran(~kenran@200116b82b9fab002cf9fc28ff8fabf2.dip.versatel-1u1.de)
2021-09-11 15:26:31 +0200acidjnk_new(~acidjnk@p5487d0ba.dip0.t-ipconnect.de) (Ping timeout: 252 seconds)
2021-09-11 15:28:43 +0200slowButPresent(~slowButPr@user/slowbutpresent)
2021-09-11 15:30:54 +0200zebrag(~chris@user/zebrag) (Ping timeout: 260 seconds)
2021-09-11 15:31:45 +0200zebrag(~chris@user/zebrag)
2021-09-11 15:33:16 +0200nattiestnate(~nate@2001:448a:20a0:4134:25e:715f:d637:5263) (Ping timeout: 252 seconds)
2021-09-11 15:34:05 +0200max22-(~maxime@2a01cb08833598008c4acb2145aa7027.ipv6.abo.wanadoo.fr) (Remote host closed the connection)
2021-09-11 15:34:34 +0200max22-(~maxime@2a01cb08833598008c4acb2145aa7027.ipv6.abo.wanadoo.fr)
2021-09-11 15:35:27 +0200neurocyte(~neurocyte@user/neurocyte) (Quit: The Lounge - https://thelounge.chat)
2021-09-11 15:39:45 +0200brandonh(brandonh@gateway/vpn/protonvpn/brandonh)
2021-09-11 15:41:06 +0200DNH(~DNH@2a02:8108:1100:16d8:412c:2d92:918c:4c0a)
2021-09-11 15:41:40 +0200MoC(~moc@user/moc)
2021-09-11 15:44:20 +0200max22-(~maxime@2a01cb08833598008c4acb2145aa7027.ipv6.abo.wanadoo.fr) (Ping timeout: 260 seconds)
2021-09-11 15:44:45 +0200ByronJohnson(~bairyn@mail.digitalkingdom.org)
2021-09-11 15:52:52 +0200mikoto-chan(~mikoto-ch@ip-83-134-2-136.dsl.scarlet.be) (Read error: No route to host)
2021-09-11 15:57:02 +0200hyiltiz(~quassel@31.220.5.250) (Ping timeout: 260 seconds)
2021-09-11 15:58:23 +0200max22-(~maxime@2a01cb0883359800283199c6bbbc014c.ipv6.abo.wanadoo.fr)
2021-09-11 16:01:04 +0200hyiltiz(~quassel@31.220.5.250)
2021-09-11 16:01:30 +0200waleee(~waleee@2001:9b0:216:8200:d457:9189:7843:1dbd)
2021-09-11 16:02:07 +0200mikoto-chan(~mikoto-ch@ip-83-134-2-136.dsl.scarlet.be)
2021-09-11 16:05:13 +0200thyriaen(~thyriaen@dynamic-077-011-222-235.77.11.pool.telefonica.de)
2021-09-11 16:06:11 +0200lavaman(~lavaman@98.38.249.169)
2021-09-11 16:10:34 +0200lavaman(~lavaman@98.38.249.169) (Ping timeout: 260 seconds)
2021-09-11 16:11:45 +0200kuribas(~user@ptr-25vy0i92albk3w04mlr.18120a2.ip6.access.telenet.be)
2021-09-11 16:12:19 +0200aman(~aman@user/aman)
2021-09-11 16:12:23 +0200 <kuribas> Is there a good CGI library?
2021-09-11 16:13:29 +0200abrantesasf(abrantesas@gateway/vpn/protonvpn/abrantesasf)
2021-09-11 16:16:38 +0200 <sshine> kuribas, did you try 'cgi'?
2021-09-11 16:16:56 +0200 <kuribas> yeah, I am trying it now.
2021-09-11 16:17:08 +0200 <kuribas> It looks a bit old, but works...
2021-09-11 16:17:30 +0200 <sshine> I thought that was part of the experience of CGI :P
2021-09-11 16:17:37 +0200 <kuribas> true :)
2021-09-11 16:17:54 +0200 <sshine> why not use wai?
2021-09-11 16:17:57 +0200 <kuribas> what are the alternatives? fastcgi, running a webserver?
2021-09-11 16:18:49 +0200 <kuribas> hmm, maybe I could...
2021-09-11 16:18:54 +0200 <kuribas> but this is a stupid script.
2021-09-11 16:19:14 +0200 <kuribas> The cgi just provides some information to rundeck, to populate the input forms.
2021-09-11 16:19:19 +0200 <sshine> I would think that 'wai' is the smallest Haskell package that serves web and is actively relied upon by larger frameworks.
2021-09-11 16:19:40 +0200 <dsal> Yeah, I've gone with the "run a web server" option for a decade or two
2021-09-11 16:20:22 +0200 <sshine> I also just run a webserver. but if I were gonna run an app server, I'd still put it behind an nginx reverse proxy :)
2021-09-11 16:20:38 +0200eggplantade(~Eggplanta@2600:1700:bef1:5e10:c09c:3e60:e691:1fba)
2021-09-11 16:21:04 +0200 <kuribas> we already have a lighttpd server. We feed in cgi scripts in bash :)
2021-09-11 16:21:08 +0200pbrisbin(~patrick@2601:83:8002:d080:d2c6:37ff:fec8:a415)
2021-09-11 16:21:42 +0200 <kuribas> but for this script, instead of using bash, I thought it might be easier to do the web handling in haskell.
2021-09-11 16:23:58 +0200machinedgod(~machinedg@24.105.81.50)
2021-09-11 16:24:27 +0200 <kuribas> sshine: hm, wai looks a lot cleaner, I'll go with that, once I feel the motivated to rewrite...
2021-09-11 16:25:02 +0200eggplantade(~Eggplanta@2600:1700:bef1:5e10:c09c:3e60:e691:1fba) (Ping timeout: 260 seconds)
2021-09-11 16:26:02 +0200 <sshine> kuribas, ah, you serve bash scripts via CGI? that sounds... vulnerable :D
2021-09-11 16:26:20 +0200 <kuribas> sshine: it's only for internal use
2021-09-11 16:26:24 +0200 <sshine> kuribas, ah, okay.
2021-09-11 16:29:12 +0200 <kuribas> is there a parser for querystrings?
2021-09-11 16:29:24 +0200 <kuribas> like optparse-applicative, but for query strings?
2021-09-11 16:29:53 +0200 <sshine> kuribas, https://hackage.haskell.org/package/wai-3.2.3/docs/Network-Wai.html#v:queryString ?
2021-09-11 16:30:02 +0200 <sshine> sorry, you mean compatible with the 'cgi' package.
2021-09-11 16:30:16 +0200 <kuribas> sshine: no, compatible with wai.
2021-09-11 16:31:01 +0200 <sshine> ah okay. in that case. and even then, it appears to derive the query string parser from 'http-types' package.
2021-09-11 16:31:54 +0200 <sshine> https://hackage.haskell.org/package/http-types-0.12.3/docs/Network-HTTP-Types-URI.html
2021-09-11 16:32:43 +0200sshineis trying out 'ghcup' on his new laptop. so far the experience is pretty great. :)
2021-09-11 16:34:03 +0200 <kuribas> uhm, I gotto stop coding in the weekend, and do fun stuff...
2021-09-11 16:34:09 +0200 <kuribas> Like cleaning!
2021-09-11 16:37:55 +0200amitnjha(~amit@024-216-124-116.res.spectrum.com) (Ping timeout: 265 seconds)
2021-09-11 16:38:49 +0200tzh(~tzh@c-24-21-73-154.hsd1.or.comcast.net)
2021-09-11 16:41:02 +0200harveypwca(~harveypwc@2601:246:c180:a570:2435:ba7:e573:bc26)
2021-09-11 16:41:41 +0200 <kuribas> It's just, all this non-perfect code is luring me to it...
2021-09-11 16:42:54 +0200 <kuribas> not rejecting bad unknown parameters, returning 500 when the request is wrong (instead of 404 or 400), remove stringly typed functions, ...
2021-09-11 16:46:51 +0200 <Rembane> kuribas: So much to do, so little time.
2021-09-11 16:46:56 +0200 <Rembane> kuribas: It sounds fun though.
2021-09-11 16:47:48 +0200 <kuribas> How much is OCD, how much is an actual advantage?
2021-09-11 16:49:04 +0200 <dsal> kuribas: servant?
2021-09-11 16:49:26 +0200 <kuribas> dsal: sadly no, I need to do the cleaning myself :)
2021-09-11 16:49:56 +0200 <kuribas> I heared cleaners are not that expensive though...
2021-09-11 16:50:55 +0200aman(~aman@user/aman) (Quit: aman)
2021-09-11 16:51:49 +0200 <Rembane> kuribas: Is the code you're cleaning seeing much change? Because otherwise you can probably leave it and go and play computer games instead.
2021-09-11 16:52:19 +0200 <kuribas> Rembane: it's all fresh code, written by me.
2021-09-11 16:52:31 +0200 <Rembane> kuribas: Even the bash stuff?
2021-09-11 16:52:49 +0200 <kuribas> some of it, yes
2021-09-11 16:53:01 +0200 <Rembane> Cool!
2021-09-11 16:53:55 +0200amitnjha(~amit@024-216-124-116.res.spectrum.com)
2021-09-11 16:54:03 +0200wroathe(~wroathe@c-68-54-25-135.hsd1.mn.comcast.net)
2021-09-11 16:54:03 +0200wroathe(~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Changing host)
2021-09-11 16:54:03 +0200wroathe(~wroathe@user/wroathe)
2021-09-11 16:54:17 +0200 <kuribas> I can write haskell faster than bash, but deployment is harder in haskell.
2021-09-11 16:54:23 +0200 <kuribas> (if it is not on the same machine)
2021-09-11 16:55:55 +0200 <kuribas> that's the reason we use bash, it's everywhere, and you don't need to worry about versions (as with python), docker images, etc...
2021-09-11 16:56:38 +0200 <Rembane> That's very true.
2021-09-11 16:57:19 +0200meinside(uid24933@id-24933.helmsley.irccloud.com) (Quit: Connection closed for inactivity)
2021-09-11 16:58:01 +0200haykam2(~haykam@static.100.2.21.65.clients.your-server.de) (Remote host closed the connection)
2021-09-11 16:58:03 +0200justsomeguy(~justsomeg@user/justsomeguy)
2021-09-11 16:58:15 +0200haykam1(~haykam@static.100.2.21.65.clients.your-server.de)
2021-09-11 17:02:26 +0200 <Franciman> kuribas: an answer
2021-09-11 17:02:31 +0200 <Franciman> perl
2021-09-11 17:03:00 +0200 <Franciman> if you have git, you have perl
2021-09-11 17:03:04 +0200 <Franciman> you don't have to worry about versions
2021-09-11 17:03:14 +0200 <Franciman> it is still better than bash
2021-09-11 17:04:31 +0200 <kuribas> nobody likes perl at our workplace...
2021-09-11 17:04:46 +0200Francimantakes note
2021-09-11 17:05:06 +0200 <Franciman> I can agree, until you don't get caught in the escape hell of bash
2021-09-11 17:05:37 +0200 <Franciman> on the other hand, the fact that simple bash is simple and complex bash programs are PURE EVIL
2021-09-11 17:05:51 +0200 <Franciman> it can work as a "complexity cap" so you don't make your scripts too complex
2021-09-11 17:06:06 +0200 <kuribas> Franciman: yeah, you need to use "defensive" bash.
2021-09-11 17:06:35 +0200 <kuribas> And we probably use to many bashisms, better stick to posix, and use sed, grep, etc...
2021-09-11 17:06:46 +0200 <Franciman> that's nice
2021-09-11 17:06:52 +0200 <Franciman> but don't imagine it's a cup of cake, either
2021-09-11 17:07:08 +0200 <Franciman> sometimes you want that bash thing badly
2021-09-11 17:07:45 +0200 <Franciman> POSIX is nice, but I found it a bit restrictive sometimes, when I used to code in sh
2021-09-11 17:08:15 +0200 <Franciman> a fun fact is that on a POSIX system you are guaranteed to have a c99 executable you can use to compile C programs
2021-09-11 17:08:23 +0200 <Franciman> so you can use C99 on any posix system :P
2021-09-11 17:11:59 +0200DNH(~DNH@2a02:8108:1100:16d8:412c:2d92:918c:4c0a) (Quit: Textual IRC Client: www.textualapp.com)
2021-09-11 17:13:10 +0200 <kuribas> IMO knowing bash is elitism, like, look how much of the weird syntax I understand!
2021-09-11 17:13:26 +0200 <kuribas> I bit like perl.
2021-09-11 17:14:22 +0200 <Clint> pfft, if you want elitism you should learn ksh or zsh
2021-09-11 17:14:39 +0200machinedgod(~machinedg@24.105.81.50) (Ping timeout: 265 seconds)
2021-09-11 17:16:02 +0200machinedgod(~machinedg@24.105.81.50)
2021-09-11 17:18:52 +0200pbrisbin(~patrick@2601:83:8002:d080:d2c6:37ff:fec8:a415) (Ping timeout: 252 seconds)
2021-09-11 17:19:38 +0200 <dsal> kuribas: Servant is a web framework that meets some of the requirements you were asking about. :p
2021-09-11 17:20:06 +0200kenran(~kenran@200116b82b9fab002cf9fc28ff8fabf2.dip.versatel-1u1.de) (Ping timeout: 260 seconds)
2021-09-11 17:20:19 +0200 <kuribas> dsal: I know :)
2021-09-11 17:20:45 +0200 <dsal> Ah, ok. That was pretty good
2021-09-11 17:20:45 +0200kenran(~kenran@200116b82b9fab00ce7d9e8e5214fdb7.dip.versatel-1u1.de)
2021-09-11 17:22:57 +0200son0p(~ff@181.136.122.143)
2021-09-11 17:25:26 +0200earthflax(~earthflax@202.153.44.149)
2021-09-11 17:26:45 +0200 <earthflax> hi
2021-09-11 17:33:43 +0200 <Las[m]> `hi
2021-09-11 17:36:28 +0200hiruji(~hiruji@user/hiruji) (Ping timeout: 252 seconds)
2021-09-11 17:39:26 +0200MoC(~moc@user/moc) (Quit: Konversation terminated!)
2021-09-11 17:42:19 +0200tommd(~tommd@75-164-130-101.ptld.qwest.net)
2021-09-11 17:49:40 +0200sander(~sander@user/sander) (Quit: So long! :))
2021-09-11 17:51:40 +0200sander(~sander@user/sander)
2021-09-11 17:51:42 +0200justsomeguy(~justsomeg@user/justsomeguy) (Ping timeout: 245 seconds)
2021-09-11 17:52:46 +0200machinedgod(~machinedg@24.105.81.50) (Ping timeout: 260 seconds)
2021-09-11 17:53:28 +0200timCF(~timCF@m91-129-108-244.cust.tele2.ee)
2021-09-11 17:54:08 +0200machinedgod(~machinedg@24.105.81.50)
2021-09-11 17:54:28 +0200raehik(~raehik@cpc95906-rdng25-2-0-cust156.15-3.cable.virginm.net) (Ping timeout: 252 seconds)
2021-09-11 17:56:30 +0200 <timCF> Hello! Let's say I have `newtype A1 = A1 A0` and also `newtype A2 = A2 A1`. Let's say there are instances of class `C` for both `A0` and `A1`. I want to newtype derive class `C` for `A2` with GeneralizedNewtypeDeriving. How do I specify which instance to use (`A0` or `A1`?)
2021-09-11 17:57:47 +0200 <timCF> Basically I want to use more inner insance of `A0` in `A2` but I don't know how.
2021-09-11 17:58:38 +0200machinedgod(~machinedg@24.105.81.50) (Ping timeout: 265 seconds)
2021-09-11 17:59:23 +0200Lycurgus(~juan@98.4.112.204) (Quit: Exeunt)
2021-09-11 18:00:06 +0200andreabedini[m](~andreabed@2001:470:69fc:105::c821) (Quit: You have been kicked for being idle)
2021-09-11 18:02:23 +0200earthflax(~earthflax@202.153.44.149) (Quit: earthflax)
2021-09-11 18:02:38 +0200earthflax(~earthflax@202.153.44.149)
2021-09-11 18:07:16 +0200justsomeguy(~justsomeg@user/justsomeguy)
2021-09-11 18:12:44 +0200earthflax(~earthflax@202.153.44.149) (Quit: earthflax)
2021-09-11 18:12:59 +0200earthflax(~earthflax@202.153.44.149)
2021-09-11 18:13:36 +0200 <dsal> I'm using postgresql-simple and doing truncates in tests. It's spewing NOTICEs all over the place. Is there a way to disable this?
2021-09-11 18:14:01 +0200 <kuribas> timCF: GeneralizedNewtypeDeriving takes the immediate wrapped database.
2021-09-11 18:14:40 +0200 <kuribas> timCF: if both have the same class `C`, there is no problem.
2021-09-11 18:15:06 +0200proofofkeags_(~proofofke@205.209.28.54)
2021-09-11 18:16:01 +0200 <timCF> kuribas: Yeah, I see. Actually in my case A1 which is intermediate newtype don't have an instance
2021-09-11 18:16:12 +0200 <kuribas> you don't want an instance?
2021-09-11 18:16:23 +0200 <timCF> And it actually shouldn't have it
2021-09-11 18:16:41 +0200 <timCF> A0 already have, and A2 should derive it somehow
2021-09-11 18:16:47 +0200 <kuribas> One way for A2 is to manually unwrap the newtypes (use coerce freely) in the instance definition.
2021-09-11 18:17:01 +0200tommd(~tommd@75-164-130-101.ptld.qwest.net) (Ping timeout: 252 seconds)
2021-09-11 18:17:13 +0200 <kuribas> You could also try "deriving via A0"
2021-09-11 18:17:18 +0200 <timCF> kuribas: good point. I can just use `coerce` to write one-line instance
2021-09-11 18:18:05 +0200 <kuribas> Or use DerivingVia: https://ghc.gitlab.haskell.org/ghc/doc/users_guide/exts/deriving_via.html
2021-09-11 18:18:05 +0200econo(uid147250@user/econo)
2021-09-11 18:18:57 +0200 <kuribas> newtype A2 = A2 A1 deriving C via A0
2021-09-11 18:19:13 +0200cheater(~Username@user/cheater) (Ping timeout: 252 seconds)
2021-09-11 18:20:36 +0200eggplantade(~Eggplanta@2600:1700:bef1:5e10:c09c:3e60:e691:1fba)
2021-09-11 18:20:49 +0200mikoto-chan(~mikoto-ch@ip-83-134-2-136.dsl.scarlet.be) (Read error: Connection reset by peer)
2021-09-11 18:21:29 +0200 <timCF> kuribas: oh, actually I can not use `coerce` to manually write instance, because A1 does not expose it (only smart constructor). But `DerivingVia` worked somehow! Magic!
2021-09-11 18:22:23 +0200wonko(~wjc@62.115.229.50)
2021-09-11 18:22:24 +0200 <kuribas> hmm, I didn't know it could do that...
2021-09-11 18:22:27 +0200 <kuribas> it sounds unsafe.
2021-09-11 18:22:36 +0200 <timCF> I don't undrstand how it can work when default constructor is not exposed, but seems like it's just smarter than coece
2021-09-11 18:22:39 +0200 <timCF> * coerce
2021-09-11 18:22:55 +0200 <kuribas> Perhaps it just assumes you know what you are doing :)
2021-09-11 18:23:01 +0200 <timCF> Or just unsafe :)
2021-09-11 18:25:02 +0200 <hpc> or it's safe by some complicated reasoning
2021-09-11 18:25:43 +0200 <kuribas> Couldn't I then derive via some datatype in a library, then pry at the implementation?
2021-09-11 18:25:46 +0200cheater(~Username@user/cheater)
2021-09-11 18:26:24 +0200mikoto-chan(~mikoto-ch@ip-83-134-2-136.dsl.scarlet.be)
2021-09-11 18:28:04 +0200earthflax(~earthflax@202.153.44.149) (Quit: earthflax)
2021-09-11 18:28:35 +0200timCF(~timCF@m91-129-108-244.cust.tele2.ee) (Quit: leaving)
2021-09-11 18:30:18 +0200nicbk(~nicbk@user/nicbk)
2021-09-11 18:35:07 +0200 <dsal> The answer to my question seems to be `set client_min_messages to warning`
2021-09-11 18:36:01 +0200pavonia(~user@user/siracusa) (Quit: Bye!)
2021-09-11 18:42:59 +0200nicbk(~nicbk@user/nicbk) (Quit: nicbk)
2021-09-11 18:47:27 +0200justsomeguy(~justsomeg@user/justsomeguy) (Quit: WeeChat 3.2)
2021-09-11 18:48:56 +0200dajoer(~david@user/gvx) (Quit: leaving)
2021-09-11 18:52:38 +0200amitnjha(~amit@024-216-124-116.res.spectrum.com) (Quit: amitnjha)
2021-09-11 18:52:54 +0200amitnjha(~amit@024-216-124-116.res.spectrum.com)
2021-09-11 18:56:13 +0200hnOsmium0001(uid453710@id-453710.stonehaven.irccloud.com)
2021-09-11 18:57:59 +0200amitnjha(~amit@024-216-124-116.res.spectrum.com) (Quit: amitnjha)
2021-09-11 18:58:12 +0200amitnjha(~amit@024-216-124-116.res.spectrum.com)
2021-09-11 19:05:23 +0200Erutuon(~Erutuon@user/erutuon)
2021-09-11 19:06:53 +0200sander(~sander@user/sander) (Quit: So long! :))
2021-09-11 19:16:12 +0200kenran(~kenran@200116b82b9fab00ce7d9e8e5214fdb7.dip.versatel-1u1.de) (Quit: WeeChat info:version)
2021-09-11 19:16:46 +0200myShoggoth(~myShoggot@97-120-70-214.ptld.qwest.net) (Ping timeout: 260 seconds)
2021-09-11 19:18:47 +0200brandonh(brandonh@gateway/vpn/protonvpn/brandonh) (Ping timeout: 245 seconds)
2021-09-11 19:24:03 +0200brandonh(brandonh@gateway/vpn/protonvpn/brandonh)
2021-09-11 19:26:57 +0200tommd(~tommd@75-164-130-101.ptld.qwest.net)
2021-09-11 19:35:26 +0200Vajb(~Vajb@n1xq4ni1adi29tefj-2.v6.elisa-mobile.fi) (Ping timeout: 260 seconds)
2021-09-11 19:35:47 +0200natechan(~nate@108-233-125-227.lightspeed.sntcca.sbcglobal.net) (Ping timeout: 252 seconds)
2021-09-11 19:36:06 +0200Vajb(~Vajb@n5jcms613emg0qp3a-2.v6.elisa-mobile.fi)
2021-09-11 19:37:16 +0200sander(~sander@user/sander)
2021-09-11 19:37:46 +0200pbrisbin(~patrick@2601:83:8002:d080:d2c6:37ff:fec8:a415)
2021-09-11 19:41:42 +0200brandonh(brandonh@gateway/vpn/protonvpn/brandonh) (Quit: brandonh)
2021-09-11 19:45:42 +0200tommd(~tommd@75-164-130-101.ptld.qwest.net) (Ping timeout: 260 seconds)
2021-09-11 19:47:23 +0200rhit(~rhit@ool-44c162d8.dyn.optonline.net)
2021-09-11 19:47:34 +0200tommd(~tommd@75-164-130-101.ptld.qwest.net)
2021-09-11 19:51:47 +0200brandonh(brandonh@gateway/vpn/protonvpn/brandonh)
2021-09-11 19:52:13 +0200tommd(~tommd@75-164-130-101.ptld.qwest.net) (Ping timeout: 265 seconds)
2021-09-11 19:54:45 +0200nattiestnate(~nate@2001:448a:20a0:4134:25e:715f:d637:5263)
2021-09-11 19:55:54 +0200Pickchea(~private@user/pickchea)
2021-09-11 19:57:36 +0200brandonh(brandonh@gateway/vpn/protonvpn/brandonh) (Quit: brandonh)
2021-09-11 20:05:32 +0200tommd(~tommd@75-164-130-101.ptld.qwest.net)
2021-09-11 20:05:47 +0200Sgeo(~Sgeo@user/sgeo)
2021-09-11 20:07:50 +0200lavaman(~lavaman@98.38.249.169)
2021-09-11 20:08:19 +0200amitnjha(~amit@024-216-124-116.res.spectrum.com) (Quit: amitnjha)
2021-09-11 20:08:32 +0200amitnjha(~amit@024-216-124-116.res.spectrum.com)
2021-09-11 20:09:42 +0200raehik(~raehik@cpc95906-rdng25-2-0-cust156.15-3.cable.virginm.net)
2021-09-11 20:10:02 +0200tommd(~tommd@75-164-130-101.ptld.qwest.net) (Ping timeout: 245 seconds)
2021-09-11 20:10:10 +0200 <awpr> hmm, I couldn't reproduce GHC being willing to derive instances for newtypes with unexported constructors. IMO it'd be really scary if it would do that
2021-09-11 20:10:46 +0200 <awpr> *via coercions across unexported newtype constructors
2021-09-11 20:11:47 +0200kuribas(~user@ptr-25vy0i92albk3w04mlr.18120a2.ip6.access.telenet.be) (Quit: ERC (IRC client for Emacs 26.3))
2021-09-11 20:12:03 +0200 <awpr> looks like timCF left, but depending on what `C` is it could be that GHC can derive it without actually needing the coercion at all, I guess?
2021-09-11 20:12:07 +0200nattiestnate(~nate@2001:448a:20a0:4134:25e:715f:d637:5263) (Ping timeout: 245 seconds)
2021-09-11 20:12:31 +0200lavaman(~lavaman@98.38.249.169) (Ping timeout: 265 seconds)
2021-09-11 20:15:17 +0200tommd(~tommd@75-164-130-101.ptld.qwest.net)
2021-09-11 20:18:22 +0200 <_bin> Opinions on web frameworks? I see a few candidates like IHP, Obelisk, and Yesod, but am unsure as to how I should choose. Fairly simple web app where users can create and manage their accounts, manage alerts for certain things, and receive notifications via SMS and/or e-mail when one changes (that data will be put into a database by a separate thread.)
2021-09-11 20:18:48 +0200mikoto-chan(~mikoto-ch@ip-83-134-2-136.dsl.scarlet.be) (Ping timeout: 265 seconds)
2021-09-11 20:19:23 +0200hexology(~hexology@user/hexology)
2021-09-11 20:19:49 +0200tommd(~tommd@75-164-130-101.ptld.qwest.net) (Ping timeout: 252 seconds)
2021-09-11 20:20:21 +0200ormaaj(~ormaaj@user/ormaaj) (Killed (gold.libera.chat (Nickname regained by services)))
2021-09-11 20:21:04 +0200mikoto-chan(~mikoto-ch@ip-83-134-2-136.dsl.scarlet.be)
2021-09-11 20:21:05 +0200Guest6423(~ormaaj@user/ormaaj)
2021-09-11 20:21:25 +0200raehik(~raehik@cpc95906-rdng25-2-0-cust156.15-3.cable.virginm.net) (Ping timeout: 260 seconds)
2021-09-11 20:21:29 +0200Guest6423ormaaj
2021-09-11 20:21:49 +0200ystael(~ystael@user/ystael) (Ping timeout: 250 seconds)
2021-09-11 20:22:56 +0200mestre(~mestre@191.177.175.57) (Quit: Lost terminal)
2021-09-11 20:23:33 +0200 <sshine> _bin, if you're looking for more options, there's also WebGear: https://rkaippully.github.io/webgear/
2021-09-11 20:23:45 +0200max22-(~maxime@2a01cb0883359800283199c6bbbc014c.ipv6.abo.wanadoo.fr) (Ping timeout: 260 seconds)
2021-09-11 20:24:57 +0200tommd(~tommd@75-164-130-101.ptld.qwest.net)
2021-09-11 20:27:51 +0200 <sshine> _bin, if you want something really simple (kinda like flask for python), try wai: https://hackage.haskell.org/package/wai -- yesod is built on this.
2021-09-11 20:29:48 +0200 <_bin> sshine: Thanks. WebGear looks nice, though it doesn't include templating; do you have any experience as to which templating systems work better or worse with it?
2021-09-11 20:30:33 +0200 <sshine> _bin, I haven't used WebGear, I just recall when it was announced.
2021-09-11 20:33:12 +0200alzgh(~alzgh@user/alzgh)
2021-09-11 20:35:13 +0200neo2(~neo3@cpe-292712.ip.primehome.com) (Ping timeout: 252 seconds)
2021-09-11 20:40:38 +0200 <sshine> _bin, if you don't like shakespeare templates, I found this alternative that I quite like: https://hackage.haskell.org/package/heterocephalus
2021-09-11 20:40:49 +0200 <Franciman> is there a canonical way to derive NFData instances of datatypes?
2021-09-11 20:42:49 +0200 <awpr> Franciman: write an empty instance or turn on `DeriveAnyClass` and say `deriving NFData`
2021-09-11 20:43:06 +0200 <_bin> sshine: Thanks, I'll look into that.
2021-09-11 20:43:07 +0200 <awpr> the class comes with a default implementation based on `GHC.Generics`
2021-09-11 20:44:13 +0200 <Franciman> thanks
2021-09-11 20:44:31 +0200__monty__(~toonn@user/toonn)
2021-09-11 20:47:08 +0200lavaman(~lavaman@98.38.249.169)
2021-09-11 20:52:45 +0200max22-(~maxime@2a01cb0883359800e16e499d0efbd347.ipv6.abo.wanadoo.fr)
2021-09-11 20:54:53 +0200m5zs7k(aquares@web10.mydevil.net)
2021-09-11 20:56:53 +0200[itchyjunk](~itchyjunk@user/itchyjunk/x-7353470) (Remote host closed the connection)
2021-09-11 20:57:19 +0200[itchyjunk](~itchyjunk@user/itchyjunk/x-7353470)
2021-09-11 20:57:30 +0200falafel(~falafel@2603-8000-d801-2d68-1d6d-bf72-eba2-a20e.res6.spectrum.com)
2021-09-11 21:02:50 +0200mikoto-chan(~mikoto-ch@ip-83-134-2-136.dsl.scarlet.be) (Ping timeout: 260 seconds)
2021-09-11 21:04:21 +0200mikoto-chan(~mikoto-ch@ip-83-134-2-136.dsl.scarlet.be)
2021-09-11 21:06:26 +0200pbrisbin(~patrick@2601:83:8002:d080:d2c6:37ff:fec8:a415) (Ping timeout: 260 seconds)
2021-09-11 21:11:31 +0200falafel(~falafel@2603-8000-d801-2d68-1d6d-bf72-eba2-a20e.res6.spectrum.com) (Ping timeout: 252 seconds)
2021-09-11 21:13:04 +0200tommd(~tommd@75-164-130-101.ptld.qwest.net) (Ping timeout: 252 seconds)
2021-09-11 21:13:25 +0200mikoto-chan(~mikoto-ch@ip-83-134-2-136.dsl.scarlet.be) (Ping timeout: 265 seconds)
2021-09-11 21:14:56 +0200mikoto-chan(~mikoto-ch@ip-83-134-2-136.dsl.scarlet.be)
2021-09-11 21:21:20 +0200harveypwca(~harveypwc@2601:246:c180:a570:2435:ba7:e573:bc26) (Quit: Leaving)
2021-09-11 21:23:08 +0200myShoggoth(~myShoggot@97-120-70-214.ptld.qwest.net)
2021-09-11 21:29:26 +0200Codaraxis__(~Codaraxis@user/codaraxis)
2021-09-11 21:29:40 +0200alzgh(~alzgh@user/alzgh) (Ping timeout: 252 seconds)
2021-09-11 21:31:45 +0200alzgh(~alzgh@user/alzgh)
2021-09-11 21:33:14 +0200Codaraxis_(~Codaraxis@user/codaraxis) (Ping timeout: 265 seconds)
2021-09-11 21:34:23 +0200Codaraxis__(~Codaraxis@user/codaraxis) (Quit: Leaving)
2021-09-11 21:36:41 +0200pavonia(~user@user/siracusa)
2021-09-11 21:37:37 +0200chexum(~quassel@gateway/tor-sasl/chexum) (Remote host closed the connection)
2021-09-11 21:48:22 +0200lavaman(~lavaman@98.38.249.169) (Ping timeout: 245 seconds)
2021-09-11 21:50:24 +0200burnsidesLlama(~burnsides@dhcp168-018.wadham.ox.ac.uk)
2021-09-11 21:55:03 +0200kuribas(~user@ptr-25vy0i92albk3w04mlr.18120a2.ip6.access.telenet.be)
2021-09-11 21:59:56 +0200jtomas(~jtomas@95.red-88-11-64.dynamicip.rima-tde.net)
2021-09-11 22:01:06 +0200ablutor(~quassel@145.131.24.183) (Quit: going for vitamine d)
2021-09-11 22:02:40 +0200 <kuribas> seems merijn was right in avoiden HashMaps
2021-09-11 22:03:39 +0200amitnjha(~amit@024-216-124-116.res.spectrum.com) (Quit: amitnjha)
2021-09-11 22:03:52 +0200amitnjha(~amit@024-216-124-116.res.spectrum.com)
2021-09-11 22:05:42 +0200juhp(~juhp@128.106.188.220) (Ping timeout: 260 seconds)
2021-09-11 22:06:47 +0200juhp(~juhp@128.106.188.220)
2021-09-11 22:07:54 +0200_ht(~quassel@82-169-194-8.biz.kpn.net) (Remote host closed the connection)
2021-09-11 22:10:31 +0200jtomas_(~jtomas@95.red-88-11-64.dynamicip.rima-tde.net)
2021-09-11 22:13:50 +0200jtomas(~jtomas@95.red-88-11-64.dynamicip.rima-tde.net) (Ping timeout: 265 seconds)
2021-09-11 22:14:13 +0200Pickchea(~private@user/pickchea) (Quit: Leaving)
2021-09-11 22:15:12 +0200econo(uid147250@user/econo) (Quit: Connection closed for inactivity)
2021-09-11 22:16:24 +0200vs^(~vsl@68.101.54.227) (Remote host closed the connection)
2021-09-11 22:17:48 +0200eggplantade(~Eggplanta@2600:1700:bef1:5e10:c09c:3e60:e691:1fba) (Remote host closed the connection)
2021-09-11 22:21:59 +0200machinedgod(~machinedg@135-23-192-217.cpe.pppoe.ca)
2021-09-11 22:31:29 +0200 <sshine> context?
2021-09-11 22:33:59 +0200amitnjha(~amit@024-216-124-116.res.spectrum.com) (Quit: amitnjha)
2021-09-11 22:34:10 +0200harveypwca(~harveypwc@2601:246:c180:a570:2435:ba7:e573:bc26)
2021-09-11 22:34:22 +0200amitnjha(~amit@024-216-124-116.res.spectrum.com)
2021-09-11 22:35:29 +0200lavaman(~lavaman@98.38.249.169)
2021-09-11 22:38:52 +0200acidjnk_new(~acidjnk@p200300d0c720301980aba8353aca9eb7.dip0.t-ipconnect.de)
2021-09-11 22:40:11 +0200 <dsal> HashMaps seem like a bad idea in many use cases.
2021-09-11 22:40:59 +0200 <clever> sshine: https://cs-syd.eu/posts/2021-09-11-json-vulnerability
2021-09-11 22:41:51 +0200yoctocell`(~user@h87-96-130-155.cust.a3fiber.se)
2021-09-11 22:42:15 +0200 <dsal> Ah, I had that conversation a few days ago. :)
2021-09-11 22:42:29 +0200yoctocell`(~user@h87-96-130-155.cust.a3fiber.se) ()
2021-09-11 22:43:57 +0200 <clever> i had heard of it years ago
2021-09-11 22:44:56 +0200 <alzgh> is hashmaps in Haskell different than other languages or do you mean how they can be abused in general?
2021-09-11 22:45:44 +0200 <clever> alzgh: the problem is more that the json parser is using an unsalted hashmap to store the key/value pairs in a json object
2021-09-11 22:46:08 +0200 <clever> alzgh: so if i give you an object, where all of the keys collide, you loose all of the hashmap benefits, and it degrades into just a map with O(n) access
2021-09-11 22:46:39 +0200 <clever> and if i upload a json blob with several million colliding keys, that becomes a major cpu hog
2021-09-11 22:46:40 +0200wroathe(~wroathe@user/wroathe) (Ping timeout: 260 seconds)
2021-09-11 22:46:52 +0200 <clever> and a lot of haskell code, only validates the json after parsing, when its too late
2021-09-11 22:47:07 +0200 <kuribas> clever: That's how Aeson parses.
2021-09-11 22:47:17 +0200 <clever> kuribas: exactly
2021-09-11 22:47:32 +0200 <kuribas> It first creates a Value (using HashMaps), then uses that parse into a curstom type.
2021-09-11 22:48:09 +0200 <clever> so by the time the user code has any choice in the matter, the cpu cost of the attack has already hit you
2021-09-11 22:48:20 +0200 <clever> and its too late to defend against it
2021-09-11 22:50:09 +0200 <kuribas> The problem is that a random salt will break referential transparency when converting the hasmap to a list.
2021-09-11 22:50:42 +0200 <kuribas> For example, I assume it will rearrange the order of keys in a printed JSON.
2021-09-11 22:50:42 +0200 <clever> i can also see it being very difficult to even sneak a random salt into such a pure language
2021-09-11 22:51:12 +0200 <kuribas> But I guess other languages have that problem as well.
2021-09-11 22:51:16 +0200 <clever> in nix (another pure/functional language), all keys are converted into an int (just a global list of keys, and the index)
2021-09-11 22:51:31 +0200 <clever> so the order of key/value pairs in a set, is dependant on the order the keys had first been used
2021-09-11 22:51:48 +0200 <clever> to mask that artifact, nix will always sort the keys, by the key value, before exporting it to any list
2021-09-11 22:52:05 +0200 <clever> so converting a set to a list, always gives you a stable result, all keys are sorted
2021-09-11 22:52:22 +0200mikoto-chan(~mikoto-ch@ip-83-134-2-136.dsl.scarlet.be) (Ping timeout: 260 seconds)
2021-09-11 22:52:30 +0200 <clever> i have only been able to violate that rule once, by using mapAttrs and trace
2021-09-11 22:52:40 +0200 <clever> it still evaluates in a random order, and trace leaks that order
2021-09-11 22:52:53 +0200 <clever> but the result is still pure, and you cant see it in the actual evaluation
2021-09-11 22:53:20 +0200 <alzgh> So, in Haskell being a pure language, the hash of an input must always be the same or it breaks referential transparency?
2021-09-11 22:53:31 +0200 <alzgh> I've just started Haskell, sorry if that's obvious.
2021-09-11 22:53:31 +0200_xft0(~jaroslawj@185.234.208.208.r.toneticgroup.pl)
2021-09-11 22:53:34 +0200eggplantade(~Eggplanta@2600:1700:bef1:5e10:c09c:3e60:e691:1fba)
2021-09-11 22:53:42 +0200wroathe(~wroathe@c-75-72-98-163.hsd1.mn.comcast.net)
2021-09-11 22:53:43 +0200wroathe(~wroathe@c-75-72-98-163.hsd1.mn.comcast.net) (Changing host)
2021-09-11 22:53:43 +0200wroathe(~wroathe@user/wroathe)
2021-09-11 22:53:45 +0200 <kuribas> alzgh: if it's a pure function, yes.
2021-09-11 22:54:00 +0200 <kuribas> alzgh: btw, you want the hash to be same in another language too :)
2021-09-11 22:54:23 +0200 <alzgh> On one run too, but not on different runs necessarily. That's what the seed is for, no?
2021-09-11 22:54:29 +0200 <kuribas> yes
2021-09-11 22:54:41 +0200hexfive(~eric@50.35.83.177)
2021-09-11 22:54:53 +0200econo(uid147250@user/econo)
2021-09-11 22:54:57 +0200 <clever> ive had bugs in the past, where the perl json encoder, sorts keys randomly
2021-09-11 22:55:03 +0200 <alzgh> So, attackers can put together some data where all the hashes collide since the hashes will allways be the same.
2021-09-11 22:55:12 +0200 <clever> so even if the json is identical, 2 given json files are not
2021-09-11 22:55:28 +0200 <clever> i had to pass things thru `js --sort` to resolve that
2021-09-11 22:55:44 +0200 <kuribas> yeah, so Aeson should use Map, problem solved...
2021-09-11 22:55:58 +0200 <clever> the issue, is that the next step was using the hash of the json file, to figure out if some expensive computation had been done before or not
2021-09-11 22:56:20 +0200 <clever> kuribas: then you just have that high cpu usage all of the time, rather then only when an attacker is exploiting you
2021-09-11 22:56:49 +0200 <kuribas> clever: which is why it should reject unknown keys, when parsing into a known structure.
2021-09-11 22:57:12 +0200 <clever> kuribas: yep
2021-09-11 22:57:22 +0200 <kuribas> And don't name your keys "dufsiqopfjzempifdqfjkdmqfuimdosqfdmsqjfkmldjqsmfuiqlmsjefilmsjqfkmd"
2021-09-11 22:57:28 +0200 <clever> but the current design, will parse all keys, into a map, then run a function to convert that map into a structure
2021-09-11 22:57:30 +0200takuan(~takuan@178-116-218-225.access.telenet.be) (Remote host closed the connection)
2021-09-11 22:57:31 +0200 <kuribas> Actually that would probably be still fine :)
2021-09-11 22:57:50 +0200 <clever> the parser would need a re-design, to have a whitelist of keys
2021-09-11 22:57:51 +0200 <alzgh> map gives logarithmic insertion, access, etc. time?
2021-09-11 22:58:18 +0200 <clever> kuribas: hmmm, you could modify the FromJSON instance, to have an extra function, `isValidKey :: String -> Bool`
2021-09-11 22:58:18 +0200hexfive(~eric@50.35.83.177) (Client Quit)
2021-09-11 22:58:28 +0200 <clever> kuribas: the default would just be `_: True` to give the old behaviour
2021-09-11 22:58:31 +0200 <kuribas> yeah
2021-09-11 22:58:42 +0200 <clever> and then any malicious keys, just never hit the HashMap
2021-09-11 22:58:55 +0200Lord_of_Life(~Lord@user/lord-of-life/x-2819915) (Ping timeout: 260 seconds)
2021-09-11 22:59:00 +0200 <clever> and boom, problem solved, no need to change the salt
2021-09-11 22:59:19 +0200Lord_of_Life(~Lord@user/lord-of-life/x-2819915)
2021-09-11 22:59:19 +0200 <clever> but every single parser has to now declare a list of keys they expect
2021-09-11 22:59:46 +0200 <alzgh> that sounds reasonable to me
2021-09-11 23:00:46 +0200xff0x(~xff0x@2001:1a81:5337:500:915:acb5:b793:8885) (Ping timeout: 260 seconds)
2021-09-11 23:01:07 +0200 <kuribas> Could be added to the generic derivation.
2021-09-11 23:01:31 +0200xff0x(~xff0x@2001:1a81:5337:500:1487:c5ae:272e:6220)
2021-09-11 23:03:33 +0200 <d34df00d> kuribas: > The problem is that a random salt will break referential transparency when converting the hasmap to a list.
2021-09-11 23:03:36 +0200 <d34df00d> No it will not.
2021-09-11 23:04:03 +0200 <kuribas> d34df00d: it will change the order, no?
2021-09-11 23:04:18 +0200 <d34df00d> If salt is chosen on startup and stored somewhere (say even with unsafePerformIO or something), then you won't be able to observe that different invocations toList will change the ordering.
2021-09-11 23:04:21 +0200 <kuribas> since HashMaps are "unordered".
2021-09-11 23:04:29 +0200 <d34df00d> Because the ordering will be the same within a run.
2021-09-11 23:04:44 +0200 <kuribas> d34df00d: until you store JSON in a file, then compare them later...
2021-09-11 23:04:58 +0200 <kuribas> ok, textual compare of json is bad...
2021-09-11 23:05:27 +0200 <d34df00d> To do comparisons in a file I need to do IO, and IO is not pure.
2021-09-11 23:06:18 +0200lavaman(~lavaman@98.38.249.169) (Remote host closed the connection)
2021-09-11 23:07:05 +0200 <kuribas> the IO isn't the problem...
2021-09-11 23:08:34 +0200 <d34df00d> I think it could be simplified that referential transparency implies you could replace `let x = fun arg1 arg2; y = fun arg1 arg2 in ...` with `let x = fun arg1 arg2; y = x in ...`. And you surely can even if salt is random, and different runs of the program produce different results!
2021-09-11 23:12:14 +0200 <monochrom> Pretty sure most ToJSON instances output in an order independent of any hashing.
2021-09-11 23:13:58 +0200 <kuribas> monochrom: if they use toEncoding.
2021-09-11 23:19:40 +0200burnsidesLlama(~burnsides@dhcp168-018.wadham.ox.ac.uk) (Ping timeout: 252 seconds)
2021-09-11 23:22:06 +0200Guest|77(~Guest|77@host109-153-137-110.range109-153.btcentralplus.com)
2021-09-11 23:22:58 +0200Guest|77(~Guest|77@host109-153-137-110.range109-153.btcentralplus.com) (Client Quit)
2021-09-11 23:24:07 +0200justsomeguy(~justsomeg@user/justsomeguy)
2021-09-11 23:25:02 +0200_xft0(~jaroslawj@185.234.208.208.r.toneticgroup.pl) (Remote host closed the connection)
2021-09-11 23:28:19 +0200hyiltiz(~quassel@31.220.5.250) (Ping timeout: 252 seconds)
2021-09-11 23:29:22 +0200amitnjha(~amit@024-216-124-116.res.spectrum.com) (Quit: amitnjha)
2021-09-11 23:29:35 +0200amitnjha(~amit@024-216-124-116.res.spectrum.com)
2021-09-11 23:30:04 +0200hyiltiz(~quassel@31.220.5.250)
2021-09-11 23:30:41 +0200Gurkenglas(~Gurkengla@dslb-002-207-014-195.002.207.pools.vodafone-ip.de) (Ping timeout: 265 seconds)
2021-09-11 23:31:19 +0200geekosaur(~geekosaur@xmonad/geekosaur)
2021-09-11 23:36:45 +0200 <infinity0> i need to test a modification to the vector package; how do i make it visible in cabal? cabal seems intent on using the internal version
2021-09-11 23:37:48 +0200 <kuribas> infinity0: you can put the link to your version in cabal.project or stack.yaml
2021-09-11 23:38:01 +0200gehmehgeh(~user@user/gehmehgeh) (Quit: Leaving)
2021-09-11 23:38:20 +0200 <infinity0> hm i've done that. ok i'll try bumping the version number in vector.cabal too...
2021-09-11 23:38:53 +0200kuribas(~user@ptr-25vy0i92albk3w04mlr.18120a2.ip6.access.telenet.be) (Quit: ERC (IRC client for Emacs 26.3))
2021-09-11 23:45:04 +0200 <infinity0> ok, that worked
2021-09-11 23:47:43 +0200martin02(~silas@141.84.69.76) (Ping timeout: 252 seconds)
2021-09-11 23:49:34 +0200AlistairB(~AlistairB@121-200-5-212.79c805.syd.nbn.aussiebb.net)
2021-09-11 23:50:01 +0200martin02(~silas@141.84.69.76)
2021-09-11 23:51:58 +0200max22-(~maxime@2a01cb0883359800e16e499d0efbd347.ipv6.abo.wanadoo.fr) (Quit: Leaving)
2021-09-11 23:53:08 +0200__monty__(~toonn@user/toonn) (Quit: leaving)
2021-09-11 23:54:36 +0200alzgh(~alzgh@user/alzgh) (Quit: WeeChat 2.8)
2021-09-11 23:58:14 +0200wroathe(~wroathe@user/wroathe) (Ping timeout: 265 seconds)