Home liberachat/#haskell: Logs Calendar

Logs on 2022-12-22 (liberachat/#haskell)

00:01:20 <monochrom> haha
00:01:44 <monochrom> I was also thinking: Yoda p b a = Yoneda p a b
00:02:12 <monochrom> "contramap this you must"
00:03:04 × [Leary] quits (~Leary]@user/Leary/x-0910699) (Remote host closed the connection)
00:03:19 freeside joins (~mengwong@103.252.202.159)
00:04:21 [Leary] joins (~Leary]@user/Leary/x-0910699)
00:04:30 <EvanR> a contravariant functor is a functor as explained by yoda
00:05:09 TonyStone joins (~TonyStone@cpe-74-76-57-186.nycap.res.rr.com)
00:09:48 <monochrom> :)
00:12:37 <hpc> actually, does that mean a bidirectional mapping... contradicts itself? :D
00:13:17 jakalx parts (~jakalx@base.jakalx.net) (Error from remote client)
00:13:41 <geekosaur> only if it actually says anything?
00:13:44 <EvanR> doesn't matter, george lucas will just retcon it
00:13:58 <EvanR> or disney
00:20:14 × gurkenglas quits (~gurkengla@p548ac72e.dip0.t-ipconnect.de) (Ping timeout: 246 seconds)
00:24:10 × monochrom quits (trebla@216.138.220.146) (Quit: NO CARRIER)
00:24:11 × jludwig quits (~justin@li657-110.members.linode.com) (Remote host closed the connection)
00:24:25 jludwig joins (~justin@li657-110.members.linode.com)
00:24:25 monochrom joins (trebla@216.138.220.146)
00:27:55 × eikke quits (~NicolasT@user/NicolasT) (Ping timeout: 248 seconds)
00:29:14 × gnalzo quits (~gnalzo@2a01:e0a:498:fd50:fcc6:bb5d:489a:ce8c) (Quit: WeeChat 3.7.1)
00:40:26 × son0p quits (~ff@2604:3d08:5b7f:5540::e96e) (Ping timeout: 255 seconds)
00:40:53 × myShoggoth quits (~myShoggot@97-120-71-74.ptld.qwest.net) (Ping timeout: 246 seconds)
00:42:43 × Tuplanolla quits (~Tuplanoll@91-159-68-152.elisa-laajakaista.fi) (Quit: Leaving.)
00:44:00 burger_flipper joins (~burger_fl@lib-04-subnet-50.rdns.cenic.net)
00:45:50 jakalx joins (~jakalx@base.jakalx.net)
00:46:02 × burger_flipper quits (~burger_fl@lib-04-subnet-50.rdns.cenic.net) (Client Quit)
00:50:43 waleee joins (~waleee@2001:9b0:213:7200:cc36:a556:b1e8:b340)
00:54:35 × foul_owl quits (~kerry@71.212.143.88) (Quit: WeeChat 2.3)
00:54:56 × bitdex quits (~bitdex@gateway/tor-sasl/bitdex) (Ping timeout: 255 seconds)
01:03:44 foul_owl joins (~kerry@71.212.143.88)
01:06:38 bitdex joins (~bitdex@gateway/tor-sasl/bitdex)
01:09:08 × pa_ath quits (~pa_ath@p57979e0e.dip0.t-ipconnect.de) (Ping timeout: 260 seconds)
01:10:24 × perrierjouet quits (~perrier-j@modemcable048.127-56-74.mc.videotron.ca) (Quit: WeeChat 3.7.1)
01:11:28 wroathe joins (~wroathe@207-153-38-140.fttp.usinternet.com)
01:11:28 × wroathe quits (~wroathe@207-153-38-140.fttp.usinternet.com) (Changing host)
01:11:28 wroathe joins (~wroathe@user/wroathe)
01:22:39 × xff0x quits (~xff0x@ai071162.d.east.v6connect.net) (Ping timeout: 260 seconds)
01:36:33 × foul_owl quits (~kerry@71.212.143.88) (Ping timeout: 260 seconds)
01:39:02 × califax quits (~califax@user/califx) (Ping timeout: 255 seconds)
01:41:17 califax joins (~califax@user/califx)
01:43:56 × wroathe quits (~wroathe@user/wroathe) (Ping timeout: 246 seconds)
01:44:48 <dgpratt[m]> is there a way to "lift" a function over a newtype wrapper? I mean without doing an explicit unwrap/wrap sequence?
01:44:51 × Midjak quits (~Midjak@82.66.147.146) (Quit: This computer has gone to sleep)
01:48:52 × Wstfgl0 quits (~me-me@v.working.name) (Quit: Disconnecting on purpose.)
01:48:55 <EvanR> :t coerce . f . coerce
01:48:56 <lambdabot> error:
01:48:56 <lambdabot> • Variable not in scope: coerce :: b1 -> c
01:48:56 <lambdabot> • Perhaps you meant ‘coerced’ (imported from Control.Lens)
01:49:28 <EvanR> :t coerced
01:49:29 <lambdabot> (Profunctor p, Functor f, Coercible s a, Coercible t b) => p a (f b) -> p s (f t)
01:49:51 foul_owl joins (~kerry@157.97.134.158)
01:53:16 <dgpratt[m]> very interesting, thanks EvanR
01:54:05 × unit73e quits (~emanuel@2001:818:e8dd:7c00:656:e5ff:fe72:9d36) (Ping timeout: 246 seconds)
01:55:03 stiell_ joins (~stiell@gateway/tor-sasl/stiell)
01:55:43 ddellacosta joins (~ddellacos@89.45.224.142)
01:56:35 × stiell quits (~stiell@gateway/tor-sasl/stiell) (Ping timeout: 255 seconds)
02:01:20 razetime joins (~quassel@49.207.230.181)
02:03:06 merijn joins (~merijn@86-86-29-250.fixed.kpn.net)
02:03:34 erisco joins (~erisco@d24-141-66-165.home.cgocable.net)
02:06:38 × [itchyjunk] quits (~itchyjunk@user/itchyjunk/x-7353470) (Ping timeout: 246 seconds)
02:06:52 xff0x joins (~xff0x@125x103x176x34.ap125.ftth.ucom.ne.jp)
02:07:49 × merijn quits (~merijn@86-86-29-250.fixed.kpn.net) (Ping timeout: 260 seconds)
02:08:32 × erisco quits (~erisco@d24-141-66-165.home.cgocable.net) (Ping timeout: 272 seconds)
02:10:09 × freeside quits (~mengwong@103.252.202.159) (Ping timeout: 260 seconds)
02:10:51 [itchyjunk] joins (~itchyjunk@user/itchyjunk/x-7353470)
02:16:44 × ezzieyguywuf quits (~Unknown@user/ezzieyguywuf) (Read error: Connection reset by peer)
02:17:01 ezzieyguywuf joins (~Unknown@user/ezzieyguywuf)
02:18:14 nehsou^ joins (~nehsou@76.145.185.103)
02:22:09 freeside joins (~mengwong@103.252.202.159)
02:24:24 Lycurgus joins (~juan@user/Lycurgus)
02:25:39 × wootehfoot quits (~wootehfoo@user/wootehfoot) (Read error: Connection reset by peer)
02:27:34 <jackdk> EvanR: from `bifunctors:Data.Bifunctor.Joker`: `newtype Joker g a b = Joker :: { runJoker :: g b }`
02:48:39 × eggplantade quits (~Eggplanta@104-55-37-220.lightspeed.sntcca.sbcglobal.net) (Remote host closed the connection)
02:50:33 × L29Ah quits (~L29Ah@wikipedia/L29Ah) (Ping timeout: 256 seconds)
02:50:50 son0p joins (~ff@2604:3d08:5b7f:5540:98a9:2169:15a1:4c7f)
02:53:44 × bitdex quits (~bitdex@gateway/tor-sasl/bitdex) (Ping timeout: 255 seconds)
02:56:55 bitdex joins (~bitdex@gateway/tor-sasl/bitdex)
02:57:59 eggplantade joins (~Eggplanta@2600:1700:38c5:d800:1dcc:166b:1177:c3e0)
03:11:27 myShoggoth joins (~myShoggot@97-120-71-74.ptld.qwest.net)
03:11:29 × eggplantade quits (~Eggplanta@2600:1700:38c5:d800:1dcc:166b:1177:c3e0) (Remote host closed the connection)
03:13:08 × Kaiepi quits (~Kaiepi@108.175.84.104) (Quit: Leaving)
03:15:21 × urdh quits (~urdh@user/urdh) (Ping timeout: 268 seconds)
03:21:33 × machinedgod quits (~machinedg@d198-53-218-113.abhsia.telus.net) (Ping timeout: 260 seconds)
03:21:51 × Lycurgus quits (~juan@user/Lycurgus) (Quit: Exeunt: personae.ai-integration.biz)
03:22:17 × Unicorn_Princess quits (~Unicorn_P@user/Unicorn-Princess/x-3540542) (Quit: Leaving)
03:23:03 eggplantade joins (~Eggplanta@2600:1700:38c5:d800:1dcc:166b:1177:c3e0)
03:28:08 × td_ quits (~td@83.135.9.45) (Ping timeout: 252 seconds)
03:30:06 td_ joins (~td@83.135.9.52)
03:34:27 × eggplantade quits (~Eggplanta@2600:1700:38c5:d800:1dcc:166b:1177:c3e0) (Remote host closed the connection)
03:36:12 Inst_ joins (~Inst@2601:6c4:4081:54f0:5c02:2b13:b462:4536)
03:36:15 Inst_ is now known as Inst
03:36:32 <Inst> did anyone else read "A Pythonista tries Haskell?"
03:39:00 codaraxis___ joins (~codaraxis@user/codaraxis)
03:42:11 codaraxis joins (~codaraxis@user/codaraxis)
03:42:54 × codaraxis__ quits (~codaraxis@user/codaraxis) (Ping timeout: 260 seconds)
03:45:28 × codaraxis___ quits (~codaraxis@user/codaraxis) (Ping timeout: 260 seconds)
03:46:42 eggplantade joins (~Eggplanta@104-55-37-220.lightspeed.sntcca.sbcglobal.net)
03:47:06 × codaraxis quits (~codaraxis@user/codaraxis) (Ping timeout: 265 seconds)
03:49:36 × use-value quits (~Thunderbi@2a00:23c6:8a03:2f01:9dfe:df53:2b6:85ce) (Remote host closed the connection)
03:49:55 use-value joins (~Thunderbi@2a00:23c6:8a03:2f01:9dfe:df53:2b6:85ce)
03:50:08 <EvanR> :k Data.Bifunctor.Joker
03:50:09 <lambdabot> error:
03:50:09 <lambdabot> Not in scope: type constructor or class ‘Data.Bifunctor.Joker’
03:50:09 <lambdabot> No module named ‘Data.Bifunctor’ is imported.
03:53:33 <Inst> Well, I'm a Haskell baby that tried Python; anyone want impressions?
03:54:08 <Clint> i do not
03:54:49 <EvanR> not really
03:55:00 <EvanR> oh, I thought you meant about python
03:55:51 <Inst> https://bytes.yingw787.com/posts/2020/01/30/a_review_of_haskell/ that was the pythonista tries Haskell stuff
03:55:59 <Inst> for me, it basically comes down to, Python has great libs
03:56:03 <Inst> the coding style is shit, though
03:56:20 <Inst> and Haskell needs more EDSLs and should bother to teach an imperative style beforehand
03:57:13 <Inst> assignment and hidden state is ugly
03:57:24 <Inst> but really, great libs
03:57:31 <Inst> nothing new was said here
03:57:33 <EvanR> luckily this is haskell
03:57:40 <EvanR> and not python
03:58:51 <Inst> I mean I've always wanted to investigate Python to understand how they ended up being the second most popular language on the planet, after JS
03:58:59 <Inst> it's incredible the things they get right
03:59:07 <Inst> including how absolutely brain-dead this textbook I bought is
03:59:26 × azimut quits (~azimut@gateway/tor-sasl/azimut) (Ping timeout: 255 seconds)
04:00:36 × pavonia quits (~user@user/siracusa) (Quit: Bye!)
04:00:55 azimut joins (~azimut@gateway/tor-sasl/azimut)
04:04:25 morb joins (~morb@pool-72-80-94-112.nycmny.fios.verizon.net)
04:06:12 × beefbambi quits (~beefbambi@183.82.207.16) (Read error: Connection reset by peer)
04:07:17 × shriekingnoise quits (~shrieking@186.137.167.202) (Quit: Quit)
04:08:42 jargon joins (~jargon@174-22-192-24.phnx.qwest.net)
04:11:42 beefbambi joins (~beefbambi@183.82.207.16)
04:13:21 troydm joins (~troydm@host-176-37-124-197.b025.la.net.ua)
04:14:11 <monochrom> Libraries are caused by network effects (after you chase down multiple intermediate causes along multiple pathways).
04:14:37 <monochrom> One day you will be surprised (or not) to find that almost every popularity is caused by networking effects.
04:14:59 <monochrom> And yes it also means randomized initial conditions.
04:17:01 <monochrom> If you already know about "history is written by victors", consider also "success stories are written by victors".
04:18:19 <Inst> yeah, i'm the one to call Python the ultimate network effects library
04:18:32 <Inst> it doesn't matter if the language is flawed, as long as it can get marketed and build a massive ecosystem on top of it
04:18:48 Guest17 joins (~Guest17@2601:642:c000:2670:9a63:d40c:964:f8c9)
04:19:09 <Inst> the more interesting thing is, well, libraries tend to comprise a kind of EDSL, and Haskell actually is a better EDSL language
04:19:16 <Inst> since we don't have parens, in certain ways, we're better than Lisps
04:20:06 <Inst> Haskell marketed as an EDSL language, though, gets into the m-word problem, and it sort of makes me think that not being able to navigate the m-word problem is almost by design
04:20:41 <Inst> see this guy:
04:20:42 <Inst> https://hasura.io/blog/parser-combinators-walkthrough/#fn1
04:20:47 × morb quits (~morb@pool-72-80-94-112.nycmny.fios.verizon.net) (Remote host closed the connection)
04:24:54 × thegeekinside quits (~thegeekin@189.128.148.159) (Ping timeout: 260 seconds)
04:27:08 × Guest17 quits (~Guest17@2601:642:c000:2670:9a63:d40c:964:f8c9) (Quit: Client closed)
04:27:49 × freeside quits (~mengwong@103.252.202.159) (Ping timeout: 260 seconds)
04:29:44 × AlexNoo quits (~AlexNoo@94.233.241.57) (Read error: Connection reset by peer)
04:30:08 AlexNoo joins (~AlexNoo@94.233.241.57)
04:32:03 <EvanR> m-word problem sounds like something from abstract algebra
04:33:01 fizbin joins (~fizbin@user/fizbin)
04:34:29 <zzz> @pl h (g (f a) a)
04:34:29 <lambdabot> h (g (f a) a)
04:34:55 <zzz> wasn't there a command to further explore this kind of expressions?
04:37:02 × pflanze quits (~pflanze@159.100.249.232) (Read error: Connection reset by peer)
04:38:27 pflanze joins (~pflanze@159.100.249.232)
04:38:28 × Vajb quits (~Vajb@2001:999:250:c9:8588:6e93:7809:7816) (Read error: Connection reset by peer)
04:38:38 × [itchyjunk] quits (~itchyjunk@user/itchyjunk/x-7353470) (Read error: Connection reset by peer)
04:38:51 Vajb joins (~Vajb@hag-jnsbng11-58c3a5-27.dhcp.inet.fi)
04:41:27 × segfaultfizzbuzz quits (~segfaultf@23-93-74-212.fiber.dynamic.sonic.net) (Ping timeout: 260 seconds)
04:41:45 freeside joins (~mengwong@103.252.202.159)
04:41:48 <monochrom> heh
04:42:22 <zzz> was it yahb maybe?... can't recall
04:42:23 <monochrom> zzz, you want something like @pl \h g f a -> h (g (f a) a)
04:43:06 <zzz> oi that'll do! thanks
04:43:38 <zzz> not that it was that useful...
04:44:27 <Inst> yeah, usual monoid / monad joke
04:46:17 <zzz> this year i learned that APL-like languages use "monadic" and "dyadic" to refer to arity
04:46:30 <zzz> that confused me
04:46:33 <zzz> for a brief moment
04:47:31 × ddellacosta quits (~ddellacos@89.45.224.142) (Ping timeout: 265 seconds)
04:48:11 × freeside quits (~mengwong@103.252.202.159) (Ping timeout: 264 seconds)
04:48:28 × Vajb quits (~Vajb@hag-jnsbng11-58c3a5-27.dhcp.inet.fi) (Ping timeout: 268 seconds)
04:48:34 <monochrom> Yes, consider "monadic second-order logic" :)
04:48:46 Vajb joins (~Vajb@2001:999:250:c9:8588:6e93:7809:7816)
04:50:10 freeside joins (~mengwong@103.252.202.159)
04:52:12 × AlexNoo quits (~AlexNoo@94.233.241.57) (Read error: Connection reset by peer)
04:52:34 AlexNoo joins (~AlexNoo@94.233.241.57)
04:54:54 <zzz> interesting
04:55:38 AlexNoo_ joins (~AlexNoo@94.233.241.57)
04:57:09 AlexNoo__ joins (~AlexNoo@94.233.241.57)
04:59:21 <EvanR> I saw something called a Dyad in old dusty physics tomes. It only stands to reason there are Monads
04:59:32 × AlexNoo quits (~AlexNoo@94.233.241.57) (Ping timeout: 272 seconds)
05:00:03 AlexNoo joins (~AlexNoo@94.233.241.57)
05:01:26 × AlexNoo_ quits (~AlexNoo@94.233.241.57) (Ping timeout: 272 seconds)
05:02:42 × AlexNoo__ quits (~AlexNoo@94.233.241.57) (Ping timeout: 272 seconds)
05:03:07 <mauke> I once saw a dye ad
05:04:38 AlexNoo_ joins (~AlexNoo@94.233.241.57)
05:05:08 × beefbambi quits (~beefbambi@183.82.207.16) (Ping timeout: 246 seconds)
05:06:48 <EvanR> Not to be confused with a Dryad
05:07:35 × AlexNoo quits (~AlexNoo@94.233.241.57) (Ping timeout: 246 seconds)
05:10:59 finsternis joins (~X@23.226.237.192)
05:15:12 × AlexNoo_ quits (~AlexNoo@94.233.241.57) (Read error: Connection reset by peer)
05:15:35 AlexNoo_ joins (~AlexNoo@94.233.241.57)
05:17:06 AlexNoo__ joins (~AlexNoo@94.233.241.57)
05:20:26 × AlexNoo_ quits (~AlexNoo@94.233.241.57) (Ping timeout: 272 seconds)
05:21:29 AlexNoo__ is now known as AlexNoo
05:22:42 masterbu1lder joins (~master@user/masterbuilder)
05:25:37 <maerwald> can exceptions leak out of unsafeInterleaveIO?
05:25:53 beefbambi joins (~beefbambi@183.82.207.16)
05:26:59 <maerwald> as in: unsafeInterleaveIO $ handle (\e -> ...) action
05:27:05 AlexNoo_ joins (~AlexNoo@94.233.241.57)
05:30:34 × AlexNoo quits (~AlexNoo@94.233.241.57) (Ping timeout: 272 seconds)
05:33:08 AlexNoo_ is now known as AlexNoo
05:35:20 zmt01 joins (~zmt00@user/zmt00)
05:37:02 × thongpv87 quits (~thongpv87@2402:9d80:320:a717:feaf:9f69:bb0b:e288) (Read error: Connection reset by peer)
05:37:17 thongpv joins (~thongpv87@123.31.184.254)
05:39:08 × zmt00 quits (~zmt00@user/zmt00) (Ping timeout: 246 seconds)
05:43:45 urdh joins (~urdh@user/urdh)
05:44:03 AkechiShiro joins (~licht@user/akechishiro)
05:45:44 <monochrom> You have handle around action directly, so no leak.
05:46:10 <monochrom> Leak is when handle (\e -> ...) (unsafeInterleaveIO action) heh
05:57:03 L29Ah joins (~L29Ah@wikipedia/L29Ah)
06:20:53 × use-value quits (~Thunderbi@2a00:23c6:8a03:2f01:9dfe:df53:2b6:85ce) (Remote host closed the connection)
06:21:11 use-value joins (~Thunderbi@2a00:23c6:8a03:2f01:9dfe:df53:2b6:85ce)
06:22:47 × myShoggoth quits (~myShoggot@97-120-71-74.ptld.qwest.net) (Quit: Leaving)
06:31:41 bgs joins (~bgs@212-85-160-171.dynamic.telemach.net)
06:38:16 Guest8974 joins (~finn@roc37-h01-176-170-197-243.dsl.sta.abo.bbox.fr)
06:38:44 zeenk joins (~zeenk@82.79.126.109)
06:41:12 <EvanR> because unsafeInterleaveIO eats all exceptions?
06:42:08 × shachaf quits (~shachaf@user/shachaf) (Ping timeout: 246 seconds)
06:42:33 × beefbambi quits (~beefbambi@183.82.207.16) (Ping timeout: 268 seconds)
06:43:05 shachaf joins (~shachaf@user/shachaf)
06:44:15 <opqdonut> EvanR: no, because the IO gets deferred and is only run later when the result is forced, but then handle has already finished
06:45:12 <EvanR> oh
06:45:38 beefbambi joins (~beefbambi@2401:4900:230d:f57c:538c:d7cc:50c0:e377)
06:46:33 <opqdonut> cf. withFile "/etc/passwd" ReadMode hGetContents
06:46:57 <opqdonut> if you try using the result of that, you get "illegal operation (delayed read on closed handle)"
06:47:10 takuan joins (~takuan@178-116-218-225.access.telenet.be)
06:48:11 <maerwald> monochrom: I don't think it works as expected when threads are involved and the value is accessed in a thread
06:51:03 <maerwald> e.g. if your handler re-throws
06:51:18 <maerwald> then your thread will crash instead of your main
06:52:22 × waleee quits (~waleee@2001:9b0:213:7200:cc36:a556:b1e8:b340) (Quit: WeeChat 3.7.1)
06:52:57 <monochrom> Ugh /etc/passwd is a bad example because it's world-readable, you won't have a problem.
06:54:39 <opqdonut> right yeah I was demonstrating a resource leak, not an exception
06:55:15 <monochrom> Ah sorry, you're right, the hClose in withFile.
06:55:20 <opqdonut> but if you try that with a non-readable file you'll get an exception from openFile within withFile, the hGetContents won't get to run
06:57:18 <monochrom> maerwald: That's my expectation.
06:57:24 <maerwald> My issue is not with streaming. I can't pass an IO action, because it would be executed multiple times. Fully evaluating the value is not desired, because not all code-paths actually need it. Changing that would be a major refactor.
06:58:14 <maerwald> but yeah, the error handling is trash now
06:58:43 × bitdex quits (~bitdex@gateway/tor-sasl/bitdex) (Remote host closed the connection)
07:01:03 bitdex joins (~bitdex@gateway/tor-sasl/bitdex)
07:02:43 waleee joins (~waleee@2001:9b0:213:7200:cc36:a556:b1e8:b340)
07:08:44 × waleee quits (~waleee@2001:9b0:213:7200:cc36:a556:b1e8:b340) (Quit: WeeChat 3.7.1)
07:17:49 × bgs quits (~bgs@212-85-160-171.dynamic.telemach.net) (Remote host closed the connection)
07:22:07 sympt joins (~sympt@user/sympt)
07:28:57 × emmanuelux quits (~emmanuelu@user/emmanuelux) (Ping timeout: 265 seconds)
07:29:28 × phma quits (phma@2001:5b0:212a:e338:ae0d:e356:1f10:5820) (Read error: Connection reset by peer)
07:30:59 phma joins (~phma@2001:5b0:211c:a268:62ac:d67:a277:8a2)
07:31:07 waleee joins (~waleee@2001:9b0:213:7200:cc36:a556:b1e8:b340)
07:35:07 mncheckm joins (~mncheck@193.224.205.254)
07:55:43 × Guest8974 quits (~finn@roc37-h01-176-170-197-243.dsl.sta.abo.bbox.fr) (Ping timeout: 260 seconds)
07:59:59 Midjak joins (~Midjak@82.66.147.146)
08:01:07 Unhammer joins (~Unhammer@user/unhammer)
08:03:22 <Unhammer> Is there a wasmer lib (like https://github.com/dirkschumacher/wasmr#example ) for haskell?
08:04:20 tromp joins (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl)
08:06:07 <Inst> EvanR: the Witcher type, the Warcraft 3 type, or the Greek mythology type?
08:10:30 lortabac joins (~lortabac@2a01:e0a:541:b8f0:f8ed:343d:34ac:2e79)
08:11:57 × eggplantade quits (~Eggplanta@104-55-37-220.lightspeed.sntcca.sbcglobal.net) (Remote host closed the connection)
08:12:38 × mncheckm quits (~mncheck@193.224.205.254) (Remote host closed the connection)
08:12:57 mncheck joins (~mncheck@193.224.205.254)
08:16:46 <Hecate> int.h>)
08:16:54 <Hecate> https://gustedt.wordpress.com/2022/12/18/checked-integer-arithmetic-in-the-prospect-of-c23/
08:17:02 <Hecate> that article is interesting from a correctness perspective
08:17:33 <Hecate> I'll probably write bindings to offer these operations in Haskell-land
08:18:10 Kaiepi joins (~Kaiepi@108.175.84.104)
08:30:47 Tuplanolla joins (~Tuplanoll@91-159-68-152.elisa-laajakaista.fi)
08:32:52 merijn joins (~merijn@86-86-29-250.fixed.kpn.net)
08:37:29 × merijn quits (~merijn@86-86-29-250.fixed.kpn.net) (Ping timeout: 260 seconds)
08:42:26 × Sgeo quits (~Sgeo@user/sgeo) (Read error: Connection reset by peer)
08:42:30 × azimut quits (~azimut@gateway/tor-sasl/azimut) (Quit: ZNC - https://znc.in)
08:44:34 azimut joins (~azimut@gateway/tor-sasl/azimut)
08:45:43 × jinsun quits (~jinsun@user/jinsun) (Ping timeout: 252 seconds)
08:50:14 fserucas joins (~fserucas@2001:818:e376:a400:fb92:70c1:dd88:c7d7)
08:51:44 vpan joins (~0@212.117.1.172)
08:52:08 machinedgod joins (~machinedg@d198-53-218-113.abhsia.telus.net)
08:56:06 jinsun joins (~jinsun@user/jinsun)
09:04:00 × troydm quits (~troydm@host-176-37-124-197.b025.la.net.ua) (Ping timeout: 272 seconds)
09:09:43 ArtsAndLeisure joins (~renate@f104006.upc-f.chello.nl)
09:12:25 eggplantade joins (~Eggplanta@2600:1700:38c5:d800:1dcc:166b:1177:c3e0)
09:12:31 <ArtsAndLeisure> Hi folks! I was wondering: what is the current best practice for benchmarking Wai applications? Thanks!
09:13:39 <Hecate> ArtsAndLeisure: locust ;-D
09:14:00 <Hecate> now if you want profiling, do you want time profiling or space profiling?
09:16:48 × eggplantade quits (~Eggplanta@2600:1700:38c5:d800:1dcc:166b:1177:c3e0) (Ping timeout: 260 seconds)
09:17:51 thongpv87 joins (~thongpv87@123.31.184.254)
09:18:34 × Xeroine quits (~Xeroine@user/xeroine) (Ping timeout: 272 seconds)
09:19:12 × tromp quits (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) (Quit: My iMac has gone to sleep. ZZZzzz…)
09:21:04 <ArtsAndLeisure> I want it all! But currently space is the most relevant for us.
09:21:06 × thongpv quits (~thongpv87@123.31.184.254) (Ping timeout: 272 seconds)
09:23:30 Xeroine joins (~Xeroine@user/xeroine)
09:24:47 × thongpv87 quits (~thongpv87@123.31.184.254) (Ping timeout: 264 seconds)
09:26:33 <Hecate> ArtsAndLeisure: do you know how to enable profiling?
09:27:15 × tzh quits (~tzh@c-24-21-73-154.hsd1.or.comcast.net) (Quit: zzz)
09:39:40 × lagash quits (lagash@lagash.shelltalk.net) (Ping timeout: 260 seconds)
09:53:34 nyr joins (~nyr@user/nyr)
10:02:39 coot joins (~coot@2a02:a310:e241:1b00:ec1a:e9df:79ac:66ba)
10:12:50 eikke joins (~NicolasT@user/NicolasT)
10:12:50 × Tuplanolla quits (~Tuplanoll@91-159-68-152.elisa-laajakaista.fi) (Ping timeout: 255 seconds)
10:14:36 MajorBiscuit joins (~MajorBisc@c-001-009-017.client.tudelft.eduvpn.nl)
10:18:02 Guest323 joins (~finn@roc37-h01-176-170-197-243.dsl.sta.abo.bbox.fr)
10:18:47 __monty__ joins (~toonn@user/toonn)
10:19:22 × econo quits (uid147250@user/econo) (Quit: Connection closed for inactivity)
10:23:04 × nyr quits (~nyr@user/nyr) (Ping timeout: 252 seconds)
10:26:40 Tuplanolla joins (~Tuplanoll@91-159-68-152.elisa-laajakaista.fi)
10:26:48 Lord_of_Life_ joins (~Lord@user/lord-of-life/x-2819915)
10:27:36 × Lord_of_Life quits (~Lord@user/lord-of-life/x-2819915) (Ping timeout: 272 seconds)
10:28:06 Lord_of_Life_ is now known as Lord_of_Life
10:30:43 × xff0x quits (~xff0x@125x103x176x34.ap125.ftth.ucom.ne.jp) (Ping timeout: 268 seconds)
10:32:25 tromp joins (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl)
10:32:47 danza joins (~francesco@151.35.107.15)
10:36:59 × danza quits (~francesco@151.35.107.15) (Ping timeout: 248 seconds)
10:43:40 × Guest323 quits (~finn@roc37-h01-176-170-197-243.dsl.sta.abo.bbox.fr) (Ping timeout: 268 seconds)
10:56:20 × mniip quits (mniip@libera/staff/mniip) (Quit: This page is intentionally left blank)
10:56:25 mniip joins (mniip@libera/staff/mniip)
11:00:19 × Xeroine quits (~Xeroine@user/xeroine) (Ping timeout: 268 seconds)
11:00:59 CiaoSen joins (~Jura@p200300c9571ee1002a3a4dfffe84dbd5.dip0.t-ipconnect.de)
11:03:00 nyr joins (~nyr@user/nyr)
11:04:54 Xeroine joins (~Xeroine@user/xeroine)
11:05:11 × nek0 quits (~nek0@2a01:4f8:222:2b41::12) (Quit: The Lounge - https://thelounge.chat)
11:05:20 × CiaoSen quits (~Jura@p200300c9571ee1002a3a4dfffe84dbd5.dip0.t-ipconnect.de) (Ping timeout: 246 seconds)
11:06:33 nek0 joins (~nek0@2a01:4f8:222:2b41::12)
11:08:23 × nyr quits (~nyr@user/nyr) (Ping timeout: 252 seconds)
11:09:38 × azimut quits (~azimut@gateway/tor-sasl/azimut) (Ping timeout: 255 seconds)
11:10:32 × stiell_ quits (~stiell@gateway/tor-sasl/stiell) (Ping timeout: 255 seconds)
11:10:59 azimut joins (~azimut@gateway/tor-sasl/azimut)
11:13:13 stiell_ joins (~stiell@gateway/tor-sasl/stiell)
11:17:31 xff0x joins (~xff0x@ai071162.d.east.v6connect.net)
11:32:57 × zeenk quits (~zeenk@82.79.126.109) (Quit: Konversation terminated!)
11:33:55 danza joins (~francesco@151.35.107.15)
11:40:23 × danza quits (~francesco@151.35.107.15) (Ping timeout: 256 seconds)
11:42:10 × coot quits (~coot@2a02:a310:e241:1b00:ec1a:e9df:79ac:66ba) (Quit: coot)
11:44:06 × anpad quits (~pandeyan@user/anpad) (Quit: ZNC 1.8.2 - https://znc.in)
11:44:07 × jmdaemon quits (~jmdaemon@user/jmdaemon) (Quit: ZNC 1.8.2 - https://znc.in)
11:45:53 anpad joins (~pandeyan@user/anpad)
12:04:54 thongpv87 joins (~thongpv87@2402:9d80:3f2:d2b5:9ab5:74c4:5552:affd)
12:04:55 bjourne joins (~bjorn@94.191.153.229.mobile.tre.se)
12:09:23 × eikke quits (~NicolasT@user/NicolasT) (Ping timeout: 268 seconds)
12:18:34 jakalx parts (~jakalx@base.jakalx.net) ()
12:21:41 jakalx joins (~jakalx@base.jakalx.net)
12:25:26 × son0p quits (~ff@2604:3d08:5b7f:5540:98a9:2169:15a1:4c7f) (Ping timeout: 246 seconds)
12:26:41 gnalzo joins (~gnalzo@2a01:e0a:498:fd50:fcc6:bb5d:489a:ce8c)
12:27:05 dextaa7 joins (~DV@user/dextaa)
12:28:35 × dextaa quits (~DV@user/dextaa) (Ping timeout: 246 seconds)
12:28:35 dextaa7 is now known as dextaa
12:33:52 eikke joins (~NicolasT@user/NicolasT)
12:37:37 coot joins (~coot@2a02:a310:e241:1b00:ec1a:e9df:79ac:66ba)
12:38:08 × tromp quits (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) (Quit: My iMac has gone to sleep. ZZZzzz…)
12:42:20 × ec quits (~ec@gateway/tor-sasl/ec) (Ping timeout: 255 seconds)
12:43:10 trev joins (~trev@user/trev)
12:43:43 ec joins (~ec@gateway/tor-sasl/ec)
12:45:34 <albet70> Inst, wang yin is a famous person lol, I don't know he writed an article about haskell
12:45:55 <Inst> what's the name order again?
12:46:04 <Inst> wang, ying, or ying, wang?
12:46:13 <Inst> wang, ying seems more probable
12:47:09 <albet70> my mistake, the author is ying wang, not yin wang
12:47:56 <albet70> the chinese name's order is the last name come first
12:48:41 <albet70> so Ying Wang's Chinese name should be Wang Ying
12:53:04 slack1256 joins (~slack1256@186.11.25.60)
12:54:29 × eikke quits (~NicolasT@user/NicolasT) (Ping timeout: 246 seconds)
12:55:27 tromp joins (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl)
12:59:50 kenran joins (~user@user/kenran)
13:00:35 × kenran quits (~user@user/kenran) (Remote host closed the connection)
13:04:02 danza joins (~francesco@151.35.107.15)
13:11:32 CiaoSen joins (~Jura@p200300c9571ee1002a3a4dfffe84dbd5.dip0.t-ipconnect.de)
13:16:03 eggplantade joins (~Eggplanta@2600:1700:38c5:d800:1dcc:166b:1177:c3e0)
13:18:27 × chexum quits (~quassel@gateway/tor-sasl/chexum) (Remote host closed the connection)
13:18:54 chexum joins (~quassel@gateway/tor-sasl/chexum)
13:19:22 × danza quits (~francesco@151.35.107.15) (Ping timeout: 265 seconds)
13:20:45 × eggplantade quits (~Eggplanta@2600:1700:38c5:d800:1dcc:166b:1177:c3e0) (Ping timeout: 260 seconds)
13:24:32 × Kaiepi quits (~Kaiepi@108.175.84.104) (Ping timeout: 255 seconds)
13:36:34 × fizbin quits (~fizbin@user/fizbin) (Remote host closed the connection)
13:36:53 fizbin joins (~fizbin@user/fizbin)
13:41:15 Unicorn_Princess joins (~Unicorn_P@user/Unicorn-Princess/x-3540542)
13:42:02 × fizbin quits (~fizbin@user/fizbin) (Ping timeout: 272 seconds)
13:47:53 × jinsun quits (~jinsun@user/jinsun) (Ping timeout: 256 seconds)
13:51:28 bontaq joins (~user@71.27.75.65)
13:55:17 fizbin joins (~fizbin@user/fizbin)
13:55:20 × elkcl quits (~elkcl@broadband-188-255-19-11.ip.moscow.rt.ru) (Ping timeout: 272 seconds)
13:58:07 elkcl joins (~elkcl@broadband-188-255-19-11.ip.moscow.rt.ru)
14:00:43 × jonathanx quits (~jonathan@h-178-174-176-109.A357.priv.bahnhof.se) (Remote host closed the connection)
14:01:32 Kaiepi joins (~Kaiepi@108.175.84.104)
14:12:38 pavonia joins (~user@user/siracusa)
14:12:46 shriekingnoise joins (~shrieking@186.137.167.202)
14:16:12 thegeekinside joins (~thegeekin@189.128.148.159)
14:24:31 × use-value quits (~Thunderbi@2a00:23c6:8a03:2f01:9dfe:df53:2b6:85ce) (Remote host closed the connection)
14:24:32 motherfsck joins (~motherfsc@user/motherfsck)
14:24:50 use-value joins (~Thunderbi@2a00:23c6:8a03:2f01:75c2:a71f:beaa:29bf)
14:25:36 danza joins (~francesco@151.47.168.96)
14:27:29 × Unicorn_Princess quits (~Unicorn_P@user/Unicorn-Princess/x-3540542) (Remote host closed the connection)
14:30:02 × danza quits (~francesco@151.47.168.96) (Read error: Connection reset by peer)
14:30:45 × raym quits (~ray@user/raym) (Quit: server maintenance, will be back in a jiffy)
14:32:20 × trev quits (~trev@user/trev) (Remote host closed the connection)
14:32:38 nyr joins (~nyr@user/nyr)
14:34:42 wroathe joins (~wroathe@207-153-38-140.fttp.usinternet.com)
14:34:42 × wroathe quits (~wroathe@207-153-38-140.fttp.usinternet.com) (Changing host)
14:34:42 wroathe joins (~wroathe@user/wroathe)
14:35:39 <stefan-_> whats the preferred way/library to fetch xml from an http endpoint and parse it?
14:36:21 × gnalzo quits (~gnalzo@2a01:e0a:498:fd50:fcc6:bb5d:489a:ce8c) (Quit: WeeChat 3.7.1)
14:38:37 son0p joins (~ff@2604:3d08:5b7f:5540:98a9:2169:15a1:4c7f)
14:39:24 jinsun joins (~jinsun@user/jinsun)
14:42:56 × wroathe quits (~wroathe@user/wroathe) (Ping timeout: 268 seconds)
14:53:17 × azimut quits (~azimut@gateway/tor-sasl/azimut) (Ping timeout: 255 seconds)
14:53:18 azimut_ joins (~azimut@gateway/tor-sasl/azimut)
14:59:06 nschoe joins (~q@141.101.51.197)
14:59:35 × fizbin quits (~fizbin@user/fizbin) (Ping timeout: 268 seconds)
15:07:36 × nyr quits (~nyr@user/nyr) (Ping timeout: 268 seconds)
15:09:49 <maerwald[m]> That would be the time to look for a new job
15:12:11 × beefbambi quits (~beefbambi@2401:4900:230d:f57c:538c:d7cc:50c0:e377) (Read error: Connection reset by peer)
15:12:52 beefbambi joins (~beefbambi@183.82.204.74)
15:18:25 × thongpv87 quits (~thongpv87@2402:9d80:3f2:d2b5:9ab5:74c4:5552:affd) (Ping timeout: 252 seconds)
15:18:40 Guest323 joins (~finn@roc37-h01-176-170-197-243.dsl.sta.abo.bbox.fr)
15:19:04 segfaultfizzbuzz joins (~segfaultf@23-93-74-212.fiber.dynamic.sonic.net)
15:34:15 mvk joins (~mvk@2607:fea8:5ce3:8500::6126)
15:34:46 × mvk quits (~mvk@2607:fea8:5ce3:8500::6126) (Client Quit)
15:35:28 lagash_ joins (lagash@lagash.shelltalk.net)
15:38:41 × mncheck quits (~mncheck@193.224.205.254) (Ping timeout: 246 seconds)
15:42:50 × ArtsAndLeisure quits (~renate@f104006.upc-f.chello.nl) (Ping timeout: 246 seconds)
15:47:12 mncheckm joins (~mncheck@193.224.205.254)
15:48:57 × lortabac quits (~lortabac@2a01:e0a:541:b8f0:f8ed:343d:34ac:2e79) (Quit: WeeChat 2.8)
15:51:39 fizbin joins (~fizbin@user/fizbin)
15:53:22 eikke joins (~NicolasT@user/NicolasT)
15:54:23 × kraftwerk28 quits (~kraftwerk@178.62.210.83) (Quit: ZNC 1.8.2 - https://znc.in)
15:55:18 kraftwerk28 joins (~kraftwerk@178.62.210.83)
15:56:30 ArtsAndLeisure joins (~renate@f104006.upc-f.chello.nl)
16:01:28 × sagax quits (~sagax_nb@user/sagax) (Remote host closed the connection)
16:02:27 × ArtsAndLeisure quits (~renate@f104006.upc-f.chello.nl) (Ping timeout: 252 seconds)
16:02:38 × Alex_test quits (~al_test@94.233.241.57) (Ping timeout: 272 seconds)
16:02:50 stef204 joins (~stef204@user/stef204)
16:03:44 × AlexZenon quits (~alzenon@94.233.241.57) (Ping timeout: 260 seconds)
16:04:19 × AlexNoo quits (~AlexNoo@94.233.241.57) (Ping timeout: 260 seconds)
16:06:23 × nehsou^ quits (~nehsou@76.145.185.103) (Remote host closed the connection)
16:07:59 × azimut_ quits (~azimut@gateway/tor-sasl/azimut) (Ping timeout: 255 seconds)
16:08:24 kjak joins (~kjak@pool-72-66-75-40.washdc.fios.verizon.net)
16:10:44 × motherfsck quits (~motherfsc@user/motherfsck) (Ping timeout: 260 seconds)
16:13:03 × bontaq quits (~user@71.27.75.65) (Ping timeout: 260 seconds)
16:18:03 × fserucas quits (~fserucas@2001:818:e376:a400:fb92:70c1:dd88:c7d7) (Ping timeout: 256 seconds)
16:20:46 ArtsAndLeisure joins (~renate@f104006.upc-f.chello.nl)
16:22:08 × jinsl quits (~jinsl@2408:8207:2558:2b10:211:32ff:fec8:6aea) (Quit: ZNC - https://znc.in)
16:26:33 jinsl joins (~jinsl@123.120.192.90)
16:28:15 × ArtsAndLeisure quits (~renate@f104006.upc-f.chello.nl) (Ping timeout: 256 seconds)
16:29:14 × eikke quits (~NicolasT@user/NicolasT) (Ping timeout: 272 seconds)
16:31:25 × waleee quits (~waleee@2001:9b0:213:7200:cc36:a556:b1e8:b340) (Ping timeout: 252 seconds)
16:32:26 rburkholder joins (~blurb@96.45.2.121)
16:33:21 jakalx parts (~jakalx@base.jakalx.net) ()
16:33:51 × nschoe quits (~q@141.101.51.197) (Quit: Switching off)
16:34:41 jakalx joins (~jakalx@base.jakalx.net)
16:36:44 gnalzo joins (~gnalzo@2a01:e0a:498:fd50:fcc6:bb5d:489a:ce8c)
16:41:57 Sgeo joins (~Sgeo@user/sgeo)
16:46:35 × CiaoSen quits (~Jura@p200300c9571ee1002a3a4dfffe84dbd5.dip0.t-ipconnect.de) (Ping timeout: 248 seconds)
16:47:31 × jinsl quits (~jinsl@123.120.192.90) (Ping timeout: 256 seconds)
16:47:33 jinsl- joins (~jinsl@2408:8207:2558:2b10:211:32ff:fec8:6aea)
16:49:23 × califax quits (~califax@user/califx) (Ping timeout: 255 seconds)
16:50:09 califax joins (~califax@user/califx)
16:50:25 eikke joins (~NicolasT@user/NicolasT)
16:51:02 eggplantade joins (~Eggplanta@104-55-37-220.lightspeed.sntcca.sbcglobal.net)
16:51:40 <kjlid[m]> https://paste.tomsmeding.com/Gaojhd7w How would I do something like this? The use-case is that I have some URIs stored in a database and I would like to get them out as Text.URI.URIs
16:51:46 <Jadesheit[m]> @src foldr
16:51:46 <lambdabot> foldr f z [] = z
16:51:46 <lambdabot> foldr f z (x:xs) = f x (foldr f z xs)
17:01:59 × beefbambi quits (~beefbambi@183.82.204.74) (Ping timeout: 264 seconds)
17:01:59 × MajorBiscuit quits (~MajorBisc@c-001-009-017.client.tudelft.eduvpn.nl) (Ping timeout: 246 seconds)
17:02:08 beefbambi joins (~beefbambi@2401:4900:230d:f57c:538c:d7cc:50c0:e377)
17:05:16 × stef204 quits (~stef204@user/stef204) (Quit: WeeChat 3.7.1)
17:07:13 <monochrom> kjlid[m]: Looks like it should be EntryURI <$> mkURI str
17:07:48 × gnalzo quits (~gnalzo@2a01:e0a:498:fd50:fcc6:bb5d:489a:ce8c) (Quit: a reboot is going on.)
17:08:01 <monochrom> replace the whole "pure $ EntryURI $ mkURI str" by that.
17:08:38 <kjlid[m]> No instance for (Control.Monad.Catch.MonadThrow Ok)
17:08:38 <kjlid[m]> arising from a use of ‘mkURI’
17:09:00 <monochrom> What is the type of mkURI?
17:09:02 Unicorn_Princess joins (~Unicorn_P@user/Unicorn-Princess/x-3540542)
17:09:26 <kjlid[m]> mkURI :: MonadThrow m => Text -> m URI
17:09:40 <mauke> :t maybe
17:09:41 <lambdabot> b -> (a -> b) -> Maybe a -> b
17:10:06 gnalzo joins (~gnalzo@2a01:e0a:498:fd50:fcc6:bb5d:489a:ce8c)
17:10:24 <mauke> catchUriException str f = maybe (returnError ConversionFailed f "Failed to parse EntryURI") (pure . EntryURI) (mkURI str)
17:10:27 <mauke> maybe
17:11:02 <kjlid[m]> Where does maybe come from?
17:11:17 <kjlid[m]> Oh
17:11:19 <kjlid[m]> That's in Prelude
17:12:34 × eikke quits (~NicolasT@user/NicolasT) (Ping timeout: 260 seconds)
17:12:37 <kjlid[m]> Ofcourse that worked. Thanks!
17:13:13 <kjlid[m]> I'm still trying to wrap my head around the type system.
17:13:42 <mauke> mkURI is (overly) generic in its return type
17:15:09 <mauke> since you're not using the ParseException anyway, we can simply treat the 'MonadThrow m' part as Maybe (which is an instance of MonadThrow)
17:15:27 <mauke> that is, we treat its type as Text -> Maybe URI
17:15:40 <mauke> @src maybe
17:15:41 <lambdabot> maybe n _ Nothing = n
17:15:41 <lambdabot> maybe _ f (Just x) = f x
17:16:21 <kjlid[m]> You just answered the next question I had but I didn't know how to formulate
17:17:07 <kjlid[m]> Again, thanks! I think something clicked in my head now
17:17:24 <mauke> we don't need to bother with 'catch' since we get to choose the MonadThrow to use, and we know Maybe represents errors as a plain Nothing value
17:17:33 <mauke> so we can simply pattern match on it
17:17:43 <mauke> (or use a helper function that does the pattern matching, like maybe)
17:18:14 <kjlid[m]> Is it rude to ask for an example of how this would be written if I wanted to actually use the ParseException?
17:18:49 <kjlid[m]> I don't think I care in this instance but it's always nice to see examples
17:18:55 <monochrom> Then you switch to Either ParseException URI
17:19:10 <mauke> not sure; I've never used ParseException before
17:19:29 <monochrom> And the helper function is "either".
17:19:35 <kjlid[m]> Ooh
17:19:37 <kjlid[m]> Ofcourse
17:19:51 <mauke> monochrom: I don't think that'll work
17:20:13 <mauke> says here: e ~ SomeException => MonadThrow (Either e)
17:20:30 <monochrom> Hrm that's bad
17:20:30 <mauke> so you need some sort of injector into SomeException
17:20:37 AlexNoo joins (~AlexNoo@94.233.241.57)
17:21:57 <mauke> oh, Either SomeException URI would probably work as is
17:22:11 <mauke> but then you'd have to fromException the result and do a dynamic test
17:22:23 Alex_test joins (~al_test@94.233.241.57)
17:22:36 × beefbambi quits (~beefbambi@2401:4900:230d:f57c:538c:d7cc:50c0:e377) (Read error: Connection reset by peer)
17:22:39 <monochrom> I have a feeling though that if someone called it "ParseException" as opposed to "ParseError" they might have made it an instance of Exception.
17:23:10 <kjlid[m]> Yeah it is an instance of Exception
17:23:18 <kjlid[m]> At least according to https://hackage.haskell.org/package/modern-uri-0.3.6.0/docs/Text-URI.html#t:ParseException
17:23:44 <monochrom> But yeah you have to go through SomeException and then downcast.
17:23:50 beefbambi joins (~beefbambi@183.82.204.74)
17:26:08 <mauke> case mkURI str of { Right uri -> pure (EntryURI uri); Left e | Just pe <- fromException e -> returnError ??? ??? ??? | otherwise -> ??? }
17:26:13 <mauke> or something like that
17:26:21 AlexZenon joins (~alzenon@94.233.241.57)
17:26:25 × beefbambi quits (~beefbambi@183.82.204.74) (Read error: Connection reset by peer)
17:27:10 beefbambi joins (~beefbambi@183.82.204.74)
17:27:38 eikke joins (~NicolasT@user/NicolasT)
17:27:40 <kjlid[m]> Wait I can just use case straight on the return value of mkURI?
17:27:55 <mauke> yes
17:28:01 <mauke> I mean, that's what 'maybe' is doing, too
17:29:11 <kjlid[m]> `Left e | Just pe <- fromException e ->` what syntax is that? I don't think I've seen that one before
17:29:11 × beefbambi quits (~beefbambi@183.82.204.74) (Read error: Connection reset by peer)
17:29:19 beefbambi joins (~beefbambi@183.82.204.74)
17:30:16 <mauke> well, it's entirely untested so it might be invalid :-)
17:30:28 <mauke> but I meant for it to be a pattern guard
17:31:31 <kjlid[m]> No it seems to works if I replace "otherwise" with "_"
17:31:38 <kjlid[m]> it seems to work even
17:31:44 × beefbambi quits (~beefbambi@183.82.204.74) (Read error: Connection reset by peer)
17:32:02 <mauke> _ shouldn't work after |
17:32:08 <mauke> https://www.haskell.org/onlinereport/haskell2010/haskellch3.html#x8-460003.13
17:32:16 <mauke> "pattern guards are of the form p <- e, where p is a pattern (see Section 3.17) of type t and e is an expression type t1. They succeed if the expression e matches the pattern p, and introduce the bindings of the pattern to the environment."
17:32:43 <kjlid[m]> Oh it's a guard ofcourse, I added is as a catch-all in the case
17:32:46 beefbambi joins (~beefbambi@183.82.204.74)
17:32:51 <mauke> oh, yeah
17:33:29 tzh joins (~tzh@c-24-21-73-154.hsd1.wa.comcast.net)
17:33:31 <kjlid[m]> Oh yeah I had to specify what type pe was too with ScopedTypeVariables
17:33:34 × eikke quits (~NicolasT@user/NicolasT) (Ping timeout: 260 seconds)
17:33:38 econo joins (uid147250@user/econo)
17:34:05 <kjlid[m]> Other than that the compiler seems happy
17:34:17 <mauke> I don't see why you would need ScopedTypeVariables
17:34:27 <mauke> you do need some code that nails down the type of pe somehow
17:34:47 <mauke> either with an explicit type signature or by passing it to a function that takes a ParseException
17:36:01 <kjlid[m]> Oh ofcourse. I'm not doing anything with pe so I guess that's why
17:36:52 <mauke> Left e | Just pe <- fromException e -> returnError ConversionFailed f ("Failed to parse EntryURI: " ++ show (pe :: ParseException)) -- or something like that
17:37:00 × vpan quits (~0@212.117.1.172) (Quit: Leaving.)
17:37:07 <mauke> I suspect 'show pe' won't be particularly human readable, though
17:37:14 <mauke> or user friendly
17:37:34 ArtsAndLeisure joins (~renate@f104006.upc-f.chello.nl)
17:38:54 <kjlid[m]> Well who cares about users anyway?
17:39:24 × beefbambi quits (~beefbambi@183.82.204.74) (Ping timeout: 260 seconds)
17:39:39 × razetime quits (~quassel@49.207.230.181) (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.)
17:40:14 <mauke> o ho ho, the constructor is public
17:40:17 MajorBiscuit joins (~MajorBisc@31-23-159.netrun.cytanet.com.cy)
17:40:40 <mauke> Left e | Just pe@ParseException{} <- fromException e -> ...
17:40:47 beefbambi joins (~beefbambi@183.82.204.74)
17:40:56 <mauke> this might be considered cheeky
17:41:09 <kjlid[m]> If it works it works
17:41:27 × beefbambi quits (~beefbambi@183.82.204.74) (Read error: Connection reset by peer)
17:42:10 beefbambi joins (~beefbambi@183.82.204.74)
17:42:19 × ArtsAndLeisure quits (~renate@f104006.upc-f.chello.nl) (Ping timeout: 260 seconds)
17:42:26 <mauke> > (\x -> case x of Nothing{} -> "it's nothing"; Just{} -> "it's something") (Just 42)
17:42:27 <lambdabot> "it's something"
17:43:05 <mauke> (for when you want to match against a constructor without caring what arguments it takes)
17:46:27 × beefbambi quits (~beefbambi@183.82.204.74) (Ping timeout: 256 seconds)
17:46:54 beefbambi joins (~beefbambi@183.82.204.74)
17:48:33 × Guest323 quits (~finn@roc37-h01-176-170-197-243.dsl.sta.abo.bbox.fr) (Ping timeout: 268 seconds)
17:49:07 stef204 joins (~stef204@user/stef204)
17:51:01 × tromp quits (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) (Quit: My iMac has gone to sleep. ZZZzzz…)
17:55:42 × stef204 quits (~stef204@user/stef204) (Quit: WeeChat 3.7.1)
18:00:16 troydm joins (~troydm@host-176-37-124-197.b025.la.net.ua)
18:02:19 Guest323 joins (~finn@roc37-h01-176-170-197-243.dsl.sta.abo.bbox.fr)
18:02:36 jmdaemon joins (~jmdaemon@user/jmdaemon)
18:04:20 zero joins (~z@user/zero)
18:05:24 tromp joins (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl)
18:07:05 × eggplantade quits (~Eggplanta@104-55-37-220.lightspeed.sntcca.sbcglobal.net) (Remote host closed the connection)
18:07:05 × beefbambi quits (~beefbambi@183.82.204.74) (Read error: Connection reset by peer)
18:07:19 beefbambi joins (~beefbambi@183.82.204.74)
18:07:35 × zzz quits (~z@user/zero) (Ping timeout: 255 seconds)
18:14:53 nyr joins (~nyr@user/nyr)
18:19:23 × tromp quits (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) (Quit: My iMac has gone to sleep. ZZZzzz…)
18:22:41 L29Ah parts (~L29Ah@wikipedia/L29Ah) ()
18:23:37 × Guest323 quits (~finn@roc37-h01-176-170-197-243.dsl.sta.abo.bbox.fr) (Ping timeout: 252 seconds)
18:23:56 tromp joins (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl)
18:24:12 raym joins (~ray@user/raym)
18:26:27 <iqubic> Is it possible to sort a list of things first by one criteria, and the use a second criteria as a tie breaker?
18:27:52 <iqubic> I have xs :: [a] and f,g :: (Ord b) => a -> b. I want to sort on the result of f, but use the result of g as tie breaker.
18:28:07 <iqubic> Well, actually, not sort, but rather minimumBy
18:29:19 <monochrom> This means (\x y -> compare (f x) (f y) <> compare (g x) (g y)) is your comparator.
18:29:20 <geekosaur> use <> to combine them
18:30:13 <geekosaur> or comparing f <> comparing g
18:30:30 <monochrom> w00t that's simpler :)
18:30:52 <geekosaur> :t comparing ?f <> comparing ?g
18:30:53 <lambdabot> (Ord a1, Ord a2, ?f::b -> a1, ?g::b -> a2) => b -> b -> Ordering
18:31:31 <iqubic> Thanks. I was trying "comparing (f <> g)" and was being told there was no semigroup instance for type b
18:31:53 × bjourne quits (~bjorn@94.191.153.229.mobile.tre.se) (Read error: Connection reset by peer)
18:32:17 <iqubic> thank you geekosaur.
18:35:10 Sciencentistguy1 joins (~sciencent@hacksoc/ordinary-member)
18:37:23 × Sciencentistguy quits (~sciencent@hacksoc/ordinary-member) (Ping timeout: 264 seconds)
18:37:23 Sciencentistguy1 is now known as Sciencentistguy
18:37:25 × malte quits (~malte@mal.tc) (Remote host closed the connection)
18:38:31 malte joins (~malte@mal.tc)
18:39:55 <mauke> :t \f g -> sortOn (\x -> (f x, g x))
18:39:57 <lambdabot> (Ord a, Ord b) => (t -> a) -> (t -> b) -> [t] -> [t]
18:40:34 motherfsck joins (~motherfsc@user/motherfsck)
18:41:05 <mauke> :t \f g -> sortOn (\x -> ((,) $! f x) $! g x)
18:41:06 <lambdabot> (Ord a, Ord b) => (t -> a) -> (t -> b) -> [t] -> [t]
18:41:22 × nyr quits (~nyr@user/nyr) (Ping timeout: 252 seconds)
18:47:18 unit73e joins (~emanuel@2001:818:e8dd:7c00:656:e5ff:fe72:9d36)
18:48:51 stef204 joins (~stef204@user/stef204)
18:52:43 × coot quits (~coot@2a02:a310:e241:1b00:ec1a:e9df:79ac:66ba) (Quit: coot)
18:53:27 coot joins (~coot@213.134.171.3)
18:56:23 × johnw quits (~johnw@2600:1700:cf00:db0:fc14:7b6c:a314:b669) (Ping timeout: 260 seconds)
18:56:46 eggplantade joins (~Eggplanta@2600:1700:38c5:d800:1dcc:166b:1177:c3e0)
18:57:59 bjourne joins (~bjorn@94.191.153.229)
19:07:28 × stef204 quits (~stef204@user/stef204) (Quit: WeeChat 3.7.1)
19:16:33 johnw joins (~johnw@2600:1700:cf00:db0:3017:1dda:5aaf:2264)
19:17:00 danza joins (~francesco@151.43.126.152)
19:17:32 × danza quits (~francesco@151.43.126.152) (Read error: Connection reset by peer)
19:22:09 Sgeo_ joins (~Sgeo@user/sgeo)
19:22:39 × Sgeo quits (~Sgeo@user/sgeo) (Ping timeout: 252 seconds)
19:24:23 texasmynsted joins (~texasmyns@99.96.221.112)
19:31:21 <iqubic> I actually want minimumBy
19:33:05 × malte quits (~malte@mal.tc) (Remote host closed the connection)
19:34:05 malte joins (~malte@mal.tc)
19:34:42 × sammelweis quits (~quassel@2601:401:8200:2d4c:bd9:d04c:7f69:eb10) (Quit: No Ping reply in 180 seconds.)
19:35:49 sammelweis joins (~quassel@2601:401:8200:2d4c:bd9:d04c:7f69:eb10)
19:37:25 <Jadesheit[m]> @pl \f -> f x y
19:37:25 <lambdabot> flip ($ x) y
19:40:06 CiaoSen joins (~Jura@p200300c9571ee1002a3a4dfffe84dbd5.dip0.t-ipconnect.de)
19:42:19 × foul_owl quits (~kerry@157.97.134.158) (Quit: WeeChat 2.3)
19:44:34 × malte quits (~malte@mal.tc) (Remote host closed the connection)
19:45:05 foul_owl joins (~kerry@157.97.134.158)
19:45:42 malte joins (~malte@mal.tc)
19:55:29 stef204 joins (~stef204@user/stef204)
19:57:21 × motherfsck quits (~motherfsc@user/motherfsck) (Ping timeout: 256 seconds)
20:03:01 Guest323 joins (~finn@roc37-h01-176-170-197-243.dsl.sta.abo.bbox.fr)
20:05:50 × fizbin quits (~fizbin@user/fizbin) (Ping timeout: 272 seconds)
20:05:56 × coot quits (~coot@213.134.171.3) (Quit: coot)
20:06:36 × phma quits (~phma@2001:5b0:211c:a268:62ac:d67:a277:8a2) (Read error: Connection reset by peer)
20:07:53 phma joins (~phma@host-67-44-208-203.hnremote.net)
20:11:44 × eggplantade quits (~Eggplanta@2600:1700:38c5:d800:1dcc:166b:1177:c3e0) (Remote host closed the connection)
20:12:02 eggplantade joins (~Eggplanta@2600:1700:38c5:d800:1dcc:166b:1177:c3e0)
20:18:06 × stef204 quits (~stef204@user/stef204) (Quit: WeeChat 3.7.1)
20:19:16 × tromp quits (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) (Quit: My iMac has gone to sleep. ZZZzzz…)
20:21:59 × eggplantade quits (~Eggplanta@2600:1700:38c5:d800:1dcc:166b:1177:c3e0) (Remote host closed the connection)
20:23:57 × Sgeo_ quits (~Sgeo@user/sgeo) (Ping timeout: 268 seconds)
20:24:44 AlexNoo_ joins (~AlexNoo@94.233.241.57)
20:25:31 × CiaoSen quits (~Jura@p200300c9571ee1002a3a4dfffe84dbd5.dip0.t-ipconnect.de) (Ping timeout: 260 seconds)
20:28:38 × AlexNoo quits (~AlexNoo@94.233.241.57) (Ping timeout: 272 seconds)
20:28:55 × AlexNoo_ quits (~AlexNoo@94.233.241.57) (Read error: Connection reset by peer)
20:29:17 AlexNoo_ joins (~AlexNoo@94.233.241.57)
20:31:22 AlexNoo__ joins (~AlexNoo@94.233.241.57)
20:34:45 × AlexNoo_ quits (~AlexNoo@94.233.241.57) (Ping timeout: 256 seconds)
20:35:48 AlexNoo_ joins (~AlexNoo@94.233.241.57)
20:35:58 mc47 joins (~mc47@xmonad/TheMC47)
20:37:25 × AlexNoo_ quits (~AlexNoo@94.233.241.57) (Read error: Connection reset by peer)
20:37:47 AlexNoo_ joins (~AlexNoo@94.233.241.57)
20:38:01 elevenkb joins (~elevenkb@105.224.37.128)
20:38:17 AlexNoo_ is now known as AlexNoo
20:38:59 × AlexNoo__ quits (~AlexNoo@94.233.241.57) (Ping timeout: 246 seconds)
20:41:20 tromp joins (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl)
20:59:49 AlexNoo_ joins (~AlexNoo@94.233.241.57)
21:01:06 × AlexNoo quits (~AlexNoo@94.233.241.57) (Read error: Connection reset by peer)
21:01:29 AlexNoo__ joins (~AlexNoo@94.233.241.57)
21:04:44 × AlexNoo_ quits (~AlexNoo@94.233.241.57) (Ping timeout: 272 seconds)
21:05:49 eikke joins (~NicolasT@user/NicolasT)
21:07:22 kenran joins (~user@user/kenran)
21:12:49 × kenran quits (~user@user/kenran) (Remote host closed the connection)
21:15:00 × tromp quits (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) (Quit: My iMac has gone to sleep. ZZZzzz…)
21:15:42 cheater joins (~Username@user/cheater)
21:15:45 × Guest323 quits (~finn@roc37-h01-176-170-197-243.dsl.sta.abo.bbox.fr) (Ping timeout: 268 seconds)
21:18:59 × mc47 quits (~mc47@xmonad/TheMC47) (Remote host closed the connection)
21:19:11 mc47 joins (~mc47@xmonad/TheMC47)
21:20:39 × mc47 quits (~mc47@xmonad/TheMC47) (Client Quit)
21:22:29 eggplantade joins (~Eggplanta@2600:1700:38c5:d800:1dcc:166b:1177:c3e0)
21:25:32 <bjourne> i have a function that emits instructions from ast nodes. would the state monad be a good fit?
21:26:01 <kjlid[m]> So I have another thing I don't quite understand. https://paste.tomsmeding.com/v2r8lKcK why do I get that error there?
21:27:42 <geekosaur> "emits" sounds like some variant of Writer to me
21:28:25 × eggplantade quits (~Eggplanta@2600:1700:38c5:d800:1dcc:166b:1177:c3e0) (Ping timeout: 260 seconds)
21:28:35 wootehfoot joins (~wootehfoo@user/wootehfoot)
21:31:48 <mauke> kjlid[m]: class Monad m => MonadError e m | m -> e where
21:32:11 <mauke> m -> e means m uniquely determines e
21:32:33 <mauke> and for m = IO, the only allowed exception type is e = IOException
21:32:45 <geekosaur> earlier discussion: [18 20:47:24] <int-e> c_wraith: FWIW, I've used the W component quite a bit in a couple of assembly-like DSLs; in that design, the reader is usually unused, the state tracks labels, and the writer collects generated code. And there's an mfix somewhere to tie the labels into a know so that they can be used before the label's declaration.
21:32:54 <kjlid[m]> oh, okay
21:32:57 <mauke> your are in IO, but trying to throw HpassError
21:33:41 <kjlid[m]> So I should just return Left?
21:34:06 <mauke> not sure, I'm not that familiar with MonadError
21:34:25 <kjlid[m]> Alright
21:34:28 <mauke> but yeah, returning it to the outer layer (where you can throw it like you want) makes sense
21:35:00 <mauke> actually ...
21:35:21 <mauke> why is this thing polymorphic at all?
21:35:38 <mauke> :t throwIO
21:35:40 <lambdabot> Exception e => e -> IO a
21:36:19 <kjlid[m]> Honestly? No reason really. I'm just learning stuff
21:36:39 <mauke> wait, I might be dumb
21:37:06 <mauke> yeah, it's actually two separate things :-)
21:37:11 <geekosaur> I wasn't sure that was in IO, since it's got that withConnection thing
21:37:35 <kjlid[m]> withConnection :: forall a. String -> (Connection -> IO a) -> IO a
21:37:53 <mauke> kjlid[m]: step 1: use throwIO instead of throwError
21:37:55 <geekosaur> okay, so yes IO
21:38:07 <mauke> you are in IO, you can throw whatever you want (as long as it's an instance of Exception)
21:38:28 <mauke> step 2: I would just drop the 'liftIO' wrapper
21:38:55 <kjlid[m]> mauke: But I wanted to catch the exceptions, handle them and *return* a proper value instead. Don't need no stinking exceptions where we're going
21:38:55 <mauke> anyone who needs createDb in some other monad can just 'liftIO (createDb ...)'
21:39:56 <mauke> kjlid[m]: huh?
21:40:04 <mauke> then why do you have throwError in there?
21:41:39 <kjlid[m]> https://hackage.haskell.org/package/mtl-2.2.2/docs/src/Control.Monad.Error.Class.html#line-134 <- I looked there and assumed it would be the same as `Left`
21:42:25 <kjlid[m]> Actually I'm an idiot
21:42:32 <kjlid[m]> It is but I accidentally used Control.Monad.Except
21:43:27 <mauke> that instance doesn't really apply here. we're in IO, not Either
21:44:08 <kjlid[m]> Actually I'm an idiot again.
21:44:21 <kjlid[m]> Alright
21:44:23 × eikke quits (~NicolasT@user/NicolasT) (Ping timeout: 260 seconds)
21:45:08 tromp joins (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl)
21:45:39 <kjlid[m]> But if I remove that liftIO then I get Couldn't match type ‘m’ with ‘IO’
21:46:12 <mauke> old type signature?
21:46:53 <kjlid[m]> What do you mean?
21:46:55 <mauke> createDb :: FilePath -> [Pubkey] -> IO [Pubkey]
21:47:34 <kjlid[m]> I want IO (Either HpassError [Pubkey])
21:48:29 <mauke> oh, there's probably a smart way to do that
21:48:40 <mauke> :t try
21:48:41 <lambdabot> Exception e => IO a -> IO (Either e a)
21:50:49 jakalx parts (~jakalx@base.jakalx.net) (Error from remote client)
21:50:58 × freeside quits (~mengwong@103.252.202.159) (Ping timeout: 272 seconds)
21:51:14 × slack1256 quits (~slack1256@186.11.25.60) (Ping timeout: 255 seconds)
21:52:04 ArtsAndLeisure joins (~renate@f104006.upc-f.chello.nl)
21:54:43 <kjlid[m]> mauke: https://paste.tomsmeding.com/5ZA990UI <- This is essentially what I want to do
21:55:09 <mauke> kjlid[m]: that return type doesn't make much sense
21:55:18 fizbin joins (~fizbin@user/fizbin)
21:55:31 <kjlid[m]> It doesn't?
21:55:31 <mauke> the only value this thing can return successfully is 'keys' as passed in by the caller
21:56:21 AlexNoo__ is now known as AlexNoo
21:56:40 <mauke> it doesn't give you any information over IO (Maybe HpassError)
21:56:43 <kjlid[m]> Because forM?
21:56:51 jakalx joins (~jakalx@base.jakalx.net)
21:57:07 <mauke> yeah
21:57:38 <mauke> you're mapping over 'keys', which gives you the current element 'k'
21:57:56 <mauke> on success, you return 'k', which forM then assembles into a list equal to 'keys'
21:58:47 × unit73e quits (~emanuel@2001:818:e8dd:7c00:656:e5ff:fe72:9d36) (Ping timeout: 246 seconds)
21:59:29 Guest3017 joins (~finn@roc37-h01-176-170-197-243.dsl.sta.abo.bbox.fr)
21:59:38 × ArtsAndLeisure quits (~renate@f104006.upc-f.chello.nl) (Quit: Leaving)
22:00:03 <kjlid[m]> Oh yeah I know that. The idea with the return type is that I'm going to return a list with "actually added" keys
22:00:27 <kjlid[m]> E.g. remove duplicates first
22:00:31 <kjlid[m]> I'm just not doing that yet
22:03:05 <kjlid[m]> But yeah, maybe it makes more sense to move that elsewhere
22:05:52 <mauke> is the HpassError type an instance of Exception?
22:06:33 <kjlid[m]> No it isn't
22:07:21 <mauke> aw
22:07:25 motherfsck joins (~motherfsc@user/motherfsck)
22:07:38 <kjlid[m]> Would it simplify stuff?
22:07:57 <kjlid[m]> I tend to avoid exceptions
22:10:04 × fizbin quits (~fizbin@user/fizbin) (Ping timeout: 260 seconds)
22:10:36 <kjlid[m]> Okay I switched to Maybe instead of Either. Is there a function that does what I want? I have looked all over the place but couldn't find anything
22:11:48 coot joins (~coot@2a02:a310:e241:1b00:ec1a:e9df:79ac:66ba)
22:13:10 <mauke> kjlid[m]: if it were, I think you could do something like: https://paste.tomsmeding.com/64RXnOt9
22:16:11 <kjlid[m]> Hmm, alright
22:18:32 × tromp quits (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) (Quit: My iMac has gone to sleep. ZZZzzz…)
22:20:57 freeside joins (~mengwong@103.252.202.159)
22:26:19 azimut joins (~azimut@gateway/tor-sasl/azimut)
22:26:24 zeenk joins (~zeenk@82.79.126.109)
22:30:52 × Kaiepi quits (~Kaiepi@108.175.84.104) (Ping timeout: 272 seconds)
22:32:36 <bjourne> when haskell says "Non-exhaustive patterns in function" can you get it to state the type name?
22:32:57 fizbin joins (~fizbin@user/fizbin)
22:33:07 <mauke> s/haskell/ghc/
22:33:33 <geekosaur> how do you know it's only one type/pattern?
22:33:36 <kjlid[m]> Is there a try that returns a Maybe instead?
22:34:30 <mauke> :t eitherToMaybe
22:34:31 <lambdabot> error: Variable not in scope: eitherToMaybe
22:34:35 <mauke> :-(
22:35:30 <geekosaur> `either (const Nothing) Just . try`
22:38:28 × Guest3017 quits (~finn@roc37-h01-176-170-197-243.dsl.sta.abo.bbox.fr) (Ping timeout: 272 seconds)
22:38:32 Kaiepi joins (~Kaiepi@108.175.84.104)
22:43:18 × cheater quits (~Username@user/cheater) (Read error: Connection reset by peer)
22:49:37 Sgeo joins (~Sgeo@user/sgeo)
22:50:11 × taeaad quits (~taeaad@user/taeaad) (Ping timeout: 260 seconds)
22:53:49 × nek0 quits (~nek0@2a01:4f8:222:2b41::12) (Quit: The Lounge - https://thelounge.chat)
22:59:08 × gnalzo quits (~gnalzo@2a01:e0a:498:fd50:fcc6:bb5d:489a:ce8c) (Quit: WeeChat 3.7.1)
23:01:45 × __monty__ quits (~toonn@user/toonn) (Quit: leaving)
23:02:14 × califax quits (~califax@user/califx) (Remote host closed the connection)
23:02:24 <kjlid[m]> https://paste.tomsmeding.com/EvuLLcEC shouldn't these two functions be the same thing?
23:02:49 califax joins (~califax@user/califx)
23:03:47 <kjlid[m]> createDb compiles, createDb2 doesn't
23:04:12 × motherfsck quits (~motherfsc@user/motherfsck) (Ping timeout: 265 seconds)
23:04:39 motherfsck joins (~motherfsc@user/motherfsck)
23:04:40 <geekosaur> I'd be wary of ($)
23:05:38 <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
23:06:30 <dsal> There's a joke about mind on $ but not $ on mind
23:08:16 nek0 joins (~nek0@2a01:4f8:222:2b41::12)
23:11:55 <kjlid[m]> But even if I do `let foo = sequence =<< forM keys ...` I get an error
23:13:48 × wootehfoot quits (~wootehfoo@user/wootehfoot) (Read error: Connection reset by peer)
23:18:53 <Square> there are no nifty methods to update lists other than take/drop combos?
23:19:14 <dsal> what?
23:19:24 <EvanR> yeah, not really
23:19:36 <dsal> I'm not entirely sure what you mean by "update" but there are countless ways to do things.
23:19:43 <EvanR> you can write a recursive function to zip to where you want to do an update and do something
23:19:55 <Square> i meant like : update :: Int -> a -> [a] -> [a], however unsafe that looks
23:19:59 <EvanR> and package that as a lens, or just use lens
23:20:18 <Square> ok, thanks
23:20:40 <EvanR> e.g. update :: Int -> (a -> a) -> [a] -> [a]
23:21:03 <EvanR> or throw a maybe in there
23:21:18 <c_wraith> > [11..17] & ix 3 %~ negate
23:21:19 <lambdabot> [11,12,13,-14,15,16,17]
23:21:31 <Square> its just for AOC so i'm not looking for something beutiful =D
23:21:51 <dsal> If you're looking to update a single thing in the middle of a list, you probably don't want a list.
23:21:55 × fizbin quits (~fizbin@user/fizbin) (Ping timeout: 256 seconds)
23:22:51 <Square> good idea, ill zip it and make a Map of it and then back
23:22:55 <dsal> Data.Sequence or Data.Map or Data.Array
23:23:27 × takuan quits (~takuan@178-116-218-225.access.telenet.be) (Remote host closed the connection)
23:24:10 <Square> sequence looks promising too. Ill ttry that
23:25:11 × MajorBiscuit quits (~MajorBisc@31-23-159.netrun.cytanet.com.cy) (Ping timeout: 260 seconds)
23:25:19 × freeside quits (~mengwong@103.252.202.159) (Ping timeout: 256 seconds)
23:25:36 <geekosaur> kjlid[m], you used <-, changing it to a let or a $ won't work, it needs a >>=
23:26:01 × coot quits (~coot@2a02:a310:e241:1b00:ec1a:e9df:79ac:66ba) (Quit: coot)
23:26:06 <geekosaur> `x <- expr` is `expr >>= \x ->`
23:27:41 × use-value quits (~Thunderbi@2a00:23c6:8a03:2f01:75c2:a71f:beaa:29bf) (Remote host closed the connection)
23:28:00 use-value joins (~Thunderbi@2a00:23c6:8a03:2f01:75c2:a71f:beaa:29bf)
23:32:54 × thegeekinside quits (~thegeekin@189.128.148.159) (Remote host closed the connection)
23:33:13 <kjlid[m]> So I redid createDb2 a little: https://paste.tomsmeding.com/BgcrsKPT
23:33:47 <dsal> I'd advise against `return` in general as it makes people think they need it. heh.
23:34:04 <kjlid[m]> Why does sequence turn into `[Either HpassError Pubkey] -> IO [Pubkey]`?
23:34:04 <dsal> `foo <- forM keys (insertKey conn) >>= sequence; return foo` is the same thing as `forM keys (insertKey conn) >>= sequence`
23:35:55 <dsal> :t sequence
23:35:56 <lambdabot> (Traversable t, Monad m) => t (m a) -> m (t a)
23:36:18 <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
23:36:34 <EvanR> especially if the number of things in the list is medium to small
23:36:55 <EvanR> or you probabilistically operate near the beginning usually
23:37:16 <dsal> kjlid[m]: It looks like you mean `sequence <$> traverse (insertKey conn) keys`
23:37:18 <EvanR> if you can stay as a Map all the time that's another story
23:37:54 freeside joins (~mengwong@103.252.202.159)
23:37:57 mvk joins (~mvk@2607:fea8:5ce3:8500::6126)
23:38:18 × mvk quits (~mvk@2607:fea8:5ce3:8500::6126) (Client Quit)
23:39:44 <Square> sure, but this isn't important work. =D
23:42:08 <dsal> Well, yeah, you don't want to convert in and out, but you should be able to do all the work in Sequence.
23:42:26 × motherfsck quits (~motherfsc@user/motherfsck) (Ping timeout: 272 seconds)
23:44:20 <kjlid[m]> dsal: I think that's literally the only combination I didn't try for some reason
23:50:59 talismanick joins (~talismani@76.133.152.122)
23:51:29 <EvanR> Seq has better asymptotics but there is some overhead making a list better (and arguably simpler) when N is expected to be low
23:51:41 <EvanR> below whatever breakeven
23:57:28 <EvanR> though Seq comes with an actual API which is nice
23:57:48 × zeenk quits (~zeenk@82.79.126.109) (Quit: Konversation terminated!)
23:59:17 cheater joins (~Username@user/cheater)
23:59:21 <dsal> Note that a lot of the API is in Data.Foldable

All times are in UTC on 2022-12-22.