Home liberachat/#haskell: Logs Calendar

Logs on 2021-10-15 (liberachat/#haskell)

00:00:49 <c_wraith> :t \x f xs -> maybe x (uncurry f) (uncons xs)
00:00:50 <lambdabot> b -> (a -> [a] -> b) -> [a] -> b
00:00:59 <c_wraith> that's just a fold
00:00:59 <monochrom> "theories" gets a bad rap. "models".
00:01:11 <c_wraith> For like... Scott encoding?
00:01:24 <monochrom> Yeah
00:01:57 <c_wraith> I kind of want that fold in base. (I know it's in some other libraries)
00:03:12 <monochrom> You know what, suppose I break that into 2 stages. 1st stage: [a] -> Maybe x. 2nd stage: Maybe x -> b, with a default for the Nothing case.
00:03:26 <yin> monochrom: thanks for the link! it's helping A LOT
00:03:52 <monochrom> Err nevermind. I wanted to say that the 1st stage is a monad morphism from [] to Maybe, haha.
00:04:08 <monochrom> But a monad morphism doesn't really change a to x.
00:05:02 <dsal> Ugh, trying microlens and kept getting an error that didn't make any sense to me. Finally tried regular lens and it worked correctly. `x ^.. folded . someMap . ix "x"` complains about not having an instance `Show (IxValue (Map Text Text))`
00:05:03 <monochrom> However! The 2nd stage is Maybe's catamorphism.
00:05:18 × jgeerds quits (~jgeerds@55d4da80.access.ecotel.net) (Ping timeout: 268 seconds)
00:06:17 <awpr> dsal: looks like a stuck type family, i.e. there's no Ix instance for Map?
00:07:00 <awpr> yeah, it's missing that instance
00:07:20 <awpr> https://hackage.haskell.org/package/microlens-0.4.12.0/docs/Lens-Micro-Internal.html#t:IxValue
00:07:42 <dsal> Oh weird. Heh. That's dumb. I guess it doesn't matter here since I can just use lookup or whatever.
00:08:01 <awpr> oh, they hid the instances in a secret package: "You can also use ix with types from array, bytestring, and containers by using microlens-ghc"
00:08:48 <dsal> Ah. I didn't think to look there.
00:09:32 <markusde> monochrom: The thing that I'm trying to model is the fact that the list monad can emulate Maybe. I think this monad morphism thing will allow me to embed (hoist? >=>?) my Maybe's into a list and all my maybe computations into list computations... right?
00:09:36 <monochrom> This is when you appreciate big-data-driven personalized advertising. "Based on your browsing history, you may like: microlens-ghc".
00:09:38 <dsal> Woo. Thanks, awpr !
00:10:38 <monochrom> markusde: I haven't tried. I only recalled the word "monad morphism" and gave it a try.
00:11:14 <markusde> monochrom: gotcha
00:11:32 <monochrom> But I am impressed that "tick :: State Int ()" can be black-box generalized.
00:12:29 <monochrom> and it is not an entirely "only works for State -> StateT m"
00:13:02 Cajun joins (~Cajun@user/cajun)
00:15:26 × ec quits (~ec@gateway/tor-sasl/ec) (Quit: ec)
00:20:33 × rbocquet quits (~weechat@2001:bc8:47a8:44e::1) (Quit: WeeChat 2.8)
00:23:28 Guest9936 joins (~Guest99@50.47.115.102)
00:26:40 <ph88> maybe dump question but in parsing i have combinators some / many .. but how do i do some operation exactly x times ?
00:27:04 × eggplantade quits (~Eggplanta@2600:1700:bef1:5e10:21fb:d4a:1e2:e3eb) (Remote host closed the connection)
00:27:20 <c_wraith> replicateM
00:27:27 <c_wraith> :t replicateM
00:27:28 <lambdabot> Applicative m => Int -> m a -> m [a]
00:27:34 <c_wraith> as you can see, it's happy with Applicative
00:27:42 <ph88> ya looks very happy !
00:27:49 <c_wraith> Or replicateM_ if you don't need the results
00:27:56 <monochrom> In parsec, you also have "count".
00:28:17 <monochrom> But "count" is hardcoded to ParsecT.
00:31:42 wroathe joins (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net)
00:31:42 × wroathe quits (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Changing host)
00:31:42 wroathe joins (~wroathe@user/wroathe)
00:33:19 <ph88> i use trifecta
00:36:05 eggplantade joins (~Eggplanta@2600:1700:bef1:5e10:21fb:d4a:1e2:e3eb)
00:39:41 merijn joins (~merijn@83-160-49-249.ip.xs4all.nl)
00:39:48 × fvr quits (uid503686@id-503686.uxbridge.irccloud.com) (Quit: Connection closed for inactivity)
00:45:50 Inst joins (~Inst@2601:6c4:4080:3f80:24f8:b8f5:afa7:ac97)
00:47:59 × Guest9936 quits (~Guest99@50.47.115.102) (Ping timeout: 256 seconds)
00:48:06 lavaman joins (~lavaman@98.38.249.169)
00:52:25 × lavaman quits (~lavaman@98.38.249.169) (Ping timeout: 252 seconds)
00:52:58 × econo quits (uid147250@user/econo) (Quit: Connection closed for inactivity)
00:53:43 <Axman6> dminuoso: you shared this with me the other day, but I'm struggling to understand the type (it's from optics yeah?) summing :: (Is k A_Fold, Is l A_Fold) => Optic' k is s a -> Optic' l js s a -> Fold s a - also I was curious to hear more about the SDN stuff you're working on
00:56:57 × slack1256 quits (~slack1256@45.4.2.52) (Ping timeout: 265 seconds)
00:57:22 × slowtyper quits (~slowtyper@user/slowtyper) (Ping timeout: 252 seconds)
01:01:20 trillp joins (~trillp@69.233.98.238)
01:02:43 × jespada quits (~jespada@host196.190-3-30.dynamic.telmex.net.ar) (Quit: My MacBook has gone to sleep. ZZZzzz…)
01:03:12 jespada joins (~jespada@2803:9800:9842:7a62:c52b:2a1d:b7c2:2b5a)
01:08:12 × jespada quits (~jespada@2803:9800:9842:7a62:c52b:2a1d:b7c2:2b5a) (Ping timeout: 268 seconds)
01:11:57 × markusde quits (~makrus@2604:3d08:6f80:6b00::2ba7) (Quit: Leaving)
01:12:25 × merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 265 seconds)
01:12:40 × albet70 quits (~xxx@2400:8902::f03c:92ff:fe60:98d8) (Remote host closed the connection)
01:13:21 × lbseale quits (~lbseale@user/ep1ctetus) (Read error: Connection reset by peer)
01:13:47 albet70 joins (~xxx@2400:8902::f03c:92ff:fe60:98d8)
01:14:26 Player001 joins (~Player001@2600:6c54:7e00:1a19:f0ca:556e:dcc6:b559)
01:19:21 meinside joins (uid24933@id-24933.helmsley.irccloud.com)
01:21:56 hololeap joins (~hololeap@user/hololeap)
01:23:50 × ph88 quits (~ph88@2a02:8109:9e00:7e5c::3d56) (Ping timeout: 260 seconds)
01:39:52 × waleee quits (~waleee@2001:9b0:216:8200:d457:9189:7843:1dbd) (Ping timeout: 268 seconds)
01:40:13 × trillp quits (~trillp@69.233.98.238) (Ping timeout: 252 seconds)
01:41:21 waleee joins (~waleee@h-98-128-228-119.NA.cust.bahnhof.se)
01:45:34 jespada joins (~jespada@2803:9800:9842:7a62:c52b:2a1d:b7c2:2b5a)
01:46:33 justsomeguy joins (~justsomeg@user/justsomeguy)
01:47:14 trillp joins (~trillp@69.233.98.238)
01:47:40 slowtyper joins (~slowtyper@user/slowtyper)
02:01:10 × xff0x quits (~xff0x@2001:1a81:5210:a600:1bfc:35a2:5bfe:31) (Ping timeout: 252 seconds)
02:02:12 × fizzsegfaultbuzz quits (~segfaultf@135-180-0-138.static.sonic.net) (Ping timeout: 265 seconds)
02:02:43 xff0x joins (~xff0x@2001:1a81:524d:6800:a178:5c71:40d3:e997)
02:15:39 × trillp quits (~trillp@69.233.98.238) (Quit: nyaa~)
02:22:37 × peterhil quits (~peterhil@dsl-hkibng32-54fb52-57.dhcp.inet.fi) (Ping timeout: 252 seconds)
02:27:20 × Katarushisu quits (~Katarushi@cpc147334-finc20-2-0-cust27.4-2.cable.virginm.net) (Quit: Ping timeout (120 seconds))
02:27:29 × justsomeguy quits (~justsomeg@user/justsomeguy) (Quit: WeeChat 3.2)
02:27:41 Katarushisu joins (~Katarushi@cpc147334-finc20-2-0-cust27.4-2.cable.virginm.net)
02:31:25 × jespada quits (~jespada@2803:9800:9842:7a62:c52b:2a1d:b7c2:2b5a) (Ping timeout: 252 seconds)
02:32:19 × ikex quits (~ash@user/ikex) (Ping timeout: 265 seconds)
02:32:36 ikex joins (~ash@user/ikex)
02:38:34 × emf quits (~emf@2620:10d:c090:400::5:c2a5) (Ping timeout: 252 seconds)
02:38:51 × CiaoSen quits (~Jura@p200300c95730dd002a3a4dfffe84dbd5.dip0.t-ipconnect.de) (Ping timeout: 245 seconds)
02:40:23 bitmapper joins (uid464869@id-464869.lymington.irccloud.com)
02:40:57 emf joins (~emf@163.114.132.1)
02:45:47 [_] joins (~itchyjunk@user/itchyjunk/x-7353470)
02:46:20 [itchyjunk] is now known as Guest1997
02:46:20 × Guest1997 quits (~itchyjunk@user/itchyjunk/x-7353470) (Killed (cadmium.libera.chat (Nickname regained by services)))
02:46:20 [_] is now known as [itchyjunk]
02:47:52 × td_ quits (~td@94.134.91.160) (Ping timeout: 252 seconds)
02:49:36 td_ joins (~td@muedsl-82-207-238-175.citykom.de)
02:50:07 × FinnElija quits (~finn_elij@user/finn-elija/x-0085643) (Ping timeout: 252 seconds)
02:52:10 FinnElija joins (~finn_elij@user/finn-elija/x-0085643)
02:53:28 × Inst quits (~Inst@2601:6c4:4080:3f80:24f8:b8f5:afa7:ac97) (Remote host closed the connection)
02:53:44 Inst joins (~Inst@2601:6c4:4080:3f80:24f8:b8f5:afa7:ac97)
02:54:04 × Player001 quits (~Player001@2600:6c54:7e00:1a19:f0ca:556e:dcc6:b559) (Quit: Client closed)
02:58:45 × machinedgod quits (~machinedg@135-23-192-217.cpe.pppoe.ca) (Ping timeout: 265 seconds)
03:03:13 falafel joins (~falafel@2603-8000-d800-688c-c469-52c4-b20d-779e.res6.spectrum.com)
03:03:25 lavaman joins (~lavaman@98.38.249.169)
03:06:24 Player001 joins (~Player001@2600:6c54:7e00:1a19:f0ca:556e:dcc6:b559)
03:13:15 × abrantesasf quits (~abrantesa@187.36.170.211) (Remote host closed the connection)
03:24:16 × falafel quits (~falafel@2603-8000-d800-688c-c469-52c4-b20d-779e.res6.spectrum.com) (Ping timeout: 245 seconds)
03:25:14 × Null_A quits (~null_a@2601:645:8700:2290:e4f7:cf97:bec9:9d10) (Remote host closed the connection)
03:26:46 × wroathe quits (~wroathe@user/wroathe) (Ping timeout: 245 seconds)
03:38:29 wroathe joins (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net)
03:38:29 × wroathe quits (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Changing host)
03:38:29 wroathe joins (~wroathe@user/wroathe)
03:40:01 × emf quits (~emf@163.114.132.1) (Quit: emf)
03:40:53 × lavaman quits (~lavaman@98.38.249.169) (Remote host closed the connection)
03:43:25 × wroathe quits (~wroathe@user/wroathe) (Ping timeout: 252 seconds)
03:45:43 × zebrag quits (~chris@user/zebrag) (Remote host closed the connection)
03:47:41 × img quits (~img@user/img) (Quit: ZNC 1.8.2 - https://znc.in)
03:48:48 × azimut quits (~azimut@gateway/tor-sasl/azimut) (Ping timeout: 276 seconds)
03:50:32 lavaman joins (~lavaman@98.38.249.169)
03:52:12 img joins (~img@user/img)
03:55:42 visortelle joins (~visortell@37.214.28.39)
03:56:17 × visortelle quits (~visortell@37.214.28.39) (Remote host closed the connection)
04:05:31 merijn joins (~merijn@83-160-49-249.ip.xs4all.nl)
04:06:13 azimut joins (~azimut@gateway/tor-sasl/azimut)
04:22:58 × img quits (~img@user/img) (Quit: ZNC 1.8.2 - https://znc.in)
04:33:25 emf joins (~emf@2620:10d:c090:400::5:c2a5)
04:37:20 connrs_ joins (~connrs@conners.plus.com)
04:37:21 img joins (~img@user/img)
04:37:22 × connrs quits (~connrs@conners.plus.com) (Ping timeout: 252 seconds)
04:37:37 connrs_ is now known as connrs
04:40:15 × merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 265 seconds)
04:43:55 × emf quits (~emf@2620:10d:c090:400::5:c2a5) (Quit: emf)
04:46:05 <dsal> OK, feeling dumb. If I have a thing that derives MonadIO, how can I have liftIO for internal use, but not export it. i.e., I don't want to derive MonadIO, but I want lift to do the right thing.
04:51:02 × waleee quits (~waleee@h-98-128-228-119.NA.cust.bahnhof.se) (Ping timeout: 268 seconds)
04:55:11 × Player001 quits (~Player001@2600:6c54:7e00:1a19:f0ca:556e:dcc6:b559) (Changing host)
04:55:11 Player001 joins (~Player001@user/player001)
05:00:04 fvr joins (uid503686@id-503686.uxbridge.irccloud.com)
05:02:58 wroathe joins (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net)
05:02:58 × wroathe quits (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Changing host)
05:02:58 wroathe joins (~wroathe@user/wroathe)
05:04:51 <nitrix> A newtype wrapping some monad transformer on IO, (since those all have MonadIO instances too). Then your module imports Control.Monad.State to have access to liftIO internally. Then your export only the newtype, not the constructors.
05:05:39 <nitrix> And you'll probably want a myTypeLiftIO :: IO a -> MyType a, and the implementation would be MyTypeConstructor . liftIO
05:05:50 abraham joins (~abraham@143.244.185.86)
05:06:10 × slowButPresent quits (~slowButPr@user/slowbutpresent) (Quit: leaving)
05:07:36 × wroathe quits (~wroathe@user/wroathe) (Ping timeout: 245 seconds)
05:09:00 × shapr quits (~user@pool-100-36-247-68.washdc.fios.verizon.net) (Ping timeout: 260 seconds)
05:09:00 <nitrix> dsal, https://gist.github.com/nitrix/e7d04267fc91bbb764bdbb2e8879a47f#file-gistfile1-hs-L33-L34
05:10:10 <nitrix> Old piece of code when I ran into the same situation, might be useful to you.
05:11:06 × wyrd quits (~wyrd@gateway/tor-sasl/wyrd) (Remote host closed the connection)
05:11:18 wyrd joins (~wyrd@gateway/tor-sasl/wyrd)
05:11:53 <dsal> Well that was hilariously easier than I expected.
05:12:26 <dsal> Actually, it was as easy as I expected, but I spent a hilariously long amount of time trying to do that in various dumb ways. heh
05:12:31 <dsal> thanks, nitrix ! :)
05:13:42 × Inst quits (~Inst@2601:6c4:4080:3f80:24f8:b8f5:afa7:ac97) (Remote host closed the connection)
05:14:00 Inst joins (~Inst@2601:6c4:4080:3f80:24f8:b8f5:afa7:ac97)
05:22:08 mei6 joins (~mei@user/mei)
05:28:41 × img quits (~img@user/img) (Quit: ZNC 1.8.2 - https://znc.in)
05:30:31 takuan joins (~takuan@178-116-218-225.access.telenet.be)
05:37:33 img joins (~img@user/img)
05:39:47 × mei6 quits (~mei@user/mei) (Quit: mei6)
05:40:22 coot joins (~coot@37.30.48.91.nat.umts.dynamic.t-mobile.pl)
05:41:00 mei6 joins (~mei@user/mei)
05:46:31 emf joins (~emf@2601:602:9400:84d:4d0:b06a:6fc2:88e4)
05:50:16 × lavaman quits (~lavaman@98.38.249.169) (Remote host closed the connection)
05:50:29 lavaman joins (~lavaman@98.38.249.169)
05:50:37 × lavaman quits (~lavaman@98.38.249.169) (Remote host closed the connection)
05:54:31 tromp joins (~textual@dhcp-077-249-230-040.chello.nl)
05:56:36 <dsal> I'm probably going to get yelled at tomorrow for introducing microlens into this test code, but it would've been ridiculously tedious to do this without it. I conflict with opinionated management. heh
06:00:44 <Axman6> dsal: do you specifically need MonadIO/liftIO, or do you need to be able to call IO from your monad?
06:01:04 <dsal> Axman6: I want to call IO from my monad but I don't want anyone else to.
06:01:12 <dsal> The above pattern was almost exactly what I had except for the lift thing.
06:03:02 <dsal> The monad in question is a `Transaction` thing that runs postgres transactions inside my app. I don't want any side effects inside the transaction.
06:03:04 <Axman6> sorry, was still catching up, yeah the myLiftIO approach is the right one
06:03:58 <dsal> It does some logging and, you know, IO, but I don't want someone making a TCP connection or launching missiles or whatever kids do these days while holding open a transaction.
06:04:18 michalz joins (~michalz@185.246.204.93)
06:04:22 <dsal> I've not shared this code yet, but I figure it'd be nice to treat it like STM.
06:04:28 <dsal> (but without the retries)
06:04:55 × Vajb quits (~Vajb@hag-jnsbng11-58c3a8-176.dhcp.inet.fi) (Read error: Connection reset by peer)
06:05:47 Vajb joins (~Vajb@hag-jnsbng11-58c3a8-176.dhcp.inet.fi)
06:06:32 × tromp quits (~textual@dhcp-077-249-230-040.chello.nl) (Quit: My iMac has gone to sleep. ZZZzzz…)
06:10:16 _ht joins (~quassel@82-169-194-8.biz.kpn.net)
06:11:33 <nitrix> Ah yeah, so you keep the myLift private and you're good.
06:11:38 Cale joins (~cale@72.139.192.117)
06:13:18 <nitrix> Err, myLiftIO, since you may still want a myLift operation as well.
06:21:07 lavaman joins (~lavaman@98.38.249.169)
06:25:43 × lavaman quits (~lavaman@98.38.249.169) (Ping timeout: 252 seconds)
06:26:42 benin joins (~benin@183.82.206.194)
06:27:00 × [itchyjunk] quits (~itchyjunk@user/itchyjunk/x-7353470) (Remote host closed the connection)
06:29:35 ubert joins (~Thunderbi@77.119.168.192.wireless.dyn.drei.com)
06:32:32 lortabac joins (~lortabac@2a01:e0a:541:b8f0:7767:27e:419a:f863)
06:32:50 × truckasaurus quits (sid457088@helmsley.irccloud.com) (Ping timeout: 245 seconds)
06:32:58 truckasaurus joins (sid457088@id-457088.helmsley.irccloud.com)
06:33:19 justHaunt1 joins (~justache@user/justache)
06:34:45 SrPx_ joins (sid108780@id-108780.uxbridge.irccloud.com)
06:34:47 edwtjo_ joins (~edwtjo@h-109-228-137-133.A213.priv.bahnhof.se)
06:34:54 × SrPx quits (sid108780@uxbridge.irccloud.com) (Ping timeout: 245 seconds)
06:34:54 × ridcully quits (~ridcully@p57b523cc.dip0.t-ipconnect.de) (Ping timeout: 245 seconds)
06:34:54 × edwtjo quits (~edwtjo@user/edwtjo) (Ping timeout: 245 seconds)
06:34:54 × justHaunt quits (~justache@user/justache) (Ping timeout: 245 seconds)
06:34:54 × Techcable quits (~Techcable@168.235.93.147) (Ping timeout: 245 seconds)
06:34:54 × ozzymcduff quits (~mathieu@81-234-151-21-no94.tbcn.telia.com) (Ping timeout: 245 seconds)
06:34:56 justHaunt1 is now known as justHaunt
06:35:19 tromp joins (~textual@dhcp-077-249-230-040.chello.nl)
06:35:42 ridcully joins (~ridcully@p57b523cc.dip0.t-ipconnect.de)
06:36:08 Techcable joins (~Techcable@168.235.93.147)
06:36:26 merijn joins (~merijn@83-160-49-249.ip.xs4all.nl)
06:36:33 ozzymcduff joins (~mathieu@81-234-151-21-no94.tbcn.telia.com)
06:39:20 × bitmapper quits (uid464869@id-464869.lymington.irccloud.com) (Quit: Connection closed for inactivity)
06:39:59 × jonathanx__ quits (~jonathan@dyn-8-sc.cdg.chalmers.se) (Ping timeout: 250 seconds)
06:43:15 × emf quits (~emf@2601:602:9400:84d:4d0:b06a:6fc2:88e4) (Quit: emf)
06:46:49 jonathanx joins (~jonathan@h-178-174-176-109.A357.priv.bahnhof.se)
06:47:58 × jonathanx quits (~jonathan@h-178-174-176-109.A357.priv.bahnhof.se) (Remote host closed the connection)
06:48:07 d34df00d parts (~d34df00d@2600:1700:8c60:3a10::48) ()
06:48:15 jonathanx joins (~jonathan@h-178-174-176-109.A357.priv.bahnhof.se)
06:49:01 jakalx parts (~jakalx@base.jakalx.net) ()
06:53:13 × _ht quits (~quassel@82-169-194-8.biz.kpn.net) (Remote host closed the connection)
07:03:52 peterhil joins (~peterhil@dsl-hkibng32-54fb52-57.dhcp.inet.fi)
07:06:43 fendor joins (~fendor@178.165.162.11.wireless.dyn.drei.com)
07:14:05 mc47 joins (~mc47@xmonad/TheMC47)
07:15:24 × eggplantade quits (~Eggplanta@2600:1700:bef1:5e10:21fb:d4a:1e2:e3eb) (Remote host closed the connection)
07:15:46 × peterhil quits (~peterhil@dsl-hkibng32-54fb52-57.dhcp.inet.fi) (Ping timeout: 252 seconds)
07:17:18 <mc47> Hey, is there a way to get a list of modules and their descriptions from the hackage docs of a package? Something like this https://xmonad.github.io/xmonad-docs/xmonad-contrib-0.16.999/
07:19:38 chele joins (~chele@user/chele)
07:27:29 × werneta quits (~werneta@70-142-214-115.lightspeed.irvnca.sbcglobal.net) (Ping timeout: 265 seconds)
07:28:59 edwtjo_ is now known as edwtjo
07:29:29 edwtjo is now known as Guest9561
07:30:52 × Guest9561 quits (~edwtjo@h-109-228-137-133.A213.priv.bahnhof.se) (Changing host)
07:30:52 Guest9561 joins (~edwtjo@user/edwtjo)
07:31:09 ph88 joins (~ph88@2a02:8109:9e00:7e5c::3d56)
07:31:10 <merijn> mc47: I don't think there's a builtin way to get that atm
07:32:30 mikoto-chan joins (~mikoto-ch@84.199.144.235)
07:32:36 <mc47> merijn: we thought so as well, I guess we'll have to rely on our self-hosted haddock docs then
07:32:37 <mc47> thank you
07:35:49 cfricke joins (~cfricke@user/cfricke)
07:35:57 jakalx joins (~jakalx@base.jakalx.net)
07:36:19 jinsun__ joins (~quassel@user/jinsun)
07:36:37 × Sgeo quits (~Sgeo@user/sgeo) (Read error: Connection reset by peer)
07:37:43 lavaman joins (~lavaman@98.38.249.169)
07:39:58 × jinsun quits (~quassel@user/jinsun) (Ping timeout: 252 seconds)
07:41:47 [exa] joins (exa@user/exa/x-3587197)
07:42:11 × lavaman quits (~lavaman@98.38.249.169) (Ping timeout: 245 seconds)
07:42:15 jinsun__ is now known as jinsun
07:43:25 dschrempf joins (~dominik@070-207.dynamic.dsl.fonira.net)
07:44:56 × abhixec quits (~abhixec@c-67-169-139-16.hsd1.ca.comcast.net) (Remote host closed the connection)
07:55:54 Xraell joins (~yourname@45.157.15.145)
07:57:31 × tdaeayusr^^ quits (~tdaeayusr@70.166.66.234) (Ping timeout: 252 seconds)
07:58:26 × mikoto-chan quits (~mikoto-ch@84.199.144.235) (Quit: mikoto-chan)
08:00:23 <absence> when resolving typeclass instances, the compiler can't tell the difference between "C a => A a" and "A a", because constraints are checked later, so they're reported as duplicates in an error. is it possible to work around that somehow by changing the structure, using language extensions, etc?
08:02:59 vpan joins (~0@212.117.1.172)
08:03:37 × srk quits (~sorki@user/srk) (Ping timeout: 252 seconds)
08:03:59 srk joins (~sorki@user/srk)
08:04:39 <merijn> absence: Not really, tbh
08:04:56 <merijn> absence: I would strongly advice avoiding scenarios like that
08:05:38 <merijn> absence: 90% of the time people (try to) do that because they want a "sensible default instance". In which case I'd advice just using DefaultSignatures and get 100x saner code for a tiny bit more verbosity
08:06:55 × ph88 quits (~ph88@2a02:8109:9e00:7e5c::3d56) (Ping timeout: 260 seconds)
08:07:07 hololeap_ joins (~hololeap@user/hololeap)
08:07:44 × hololeap quits (~hololeap@user/hololeap) (Read error: Connection reset by peer)
08:08:13 hendursa1 joins (~weechat@user/hendursaga)
08:08:48 × hendursaga quits (~weechat@user/hendursaga) (Ping timeout: 276 seconds)
08:11:07 Guest9561 is now known as edwtjo_
08:11:18 <sm> hey all. I'm using System.Process.spawnCommand to run background threads, each playing a sound effect. They end quickly, but the processes remain, in some kind of zombie state, as long as the app is running. pstree shows them parenthesised, htop shows state Z, pgrep doesn't show them at all. Do you know what's happening ?
08:12:05 <merijn> sm: You need to wait(2) on dead children
08:12:11 <merijn> You can't just blindly ignore them
08:12:20 <merijn> Else they turn into zombies
08:12:23 <sm> I am discarding their thread ids when I spawn. Is laziness biting somehow ?
08:12:52 <merijn> sm: Eh, you sound confused? spawnCommand spawns *processes* not threads?
08:12:52 <sm> wait, eh. process haddock did not mention this I think
08:13:37 <sm> sorry, not thread ids: ProcessHandle's
08:13:53 <sm> https://hackage.haskell.org/package/process-1.6.13.2/docs/System-Process.html#v:spawnCommand
08:14:00 <merijn> sm: If you drop them and never wait on subprocesses, then they will all turn into zombies, yes
08:14:31 sm is currently surrounded by an army of 1862 undead
08:14:59 <merijn> sm: See https://hackage.haskell.org/package/process-1.6.13.2/docs/System-Process.html#t:ProcessHandle and https://hackage.haskell.org/package/process-1.6.13.2/docs/System-Process.html#v:waitForProcess
08:15:43 <sm> merijn, thank you very much, most helpful
08:15:48 eggplantade joins (~Eggplanta@2600:1700:bef1:5e10:21fb:d4a:1e2:e3eb)
08:16:20 <sm> this seems to be one of things you're supposed to just know
08:17:28 <merijn> sm: The exit code is only real way child processes can report errors to their parent, so posix requires parents use wait(2) to query the exit code of the child processes. Which means the child has to stick around until the parent does that
08:17:42 × geekosaur quits (~geekosaur@xmonad/geekosaur) (Remote host closed the connection)
08:17:49 allbery_b joins (~geekosaur@xmonad/geekosaur)
08:17:52 allbery_b is now known as geekosaur
08:18:05 <sm> waitForProcess will block I think ? the haddock is a little unclear
08:18:09 <sm> "..in order to call waitForProcess without blocking all the other threads in the system.."
08:18:28 <merijn> It blocks, yes. But without -threaded it *also* blocks all other threads
08:18:41 <sm> gotcha
08:18:57 acidjnk_new3 joins (~acidjnk@p200300d0c703cb999d5eb9ee05a422b5.dip0.t-ipconnect.de)
08:19:09 ub joins (~Thunderbi@178.165.181.201.wireless.dyn.drei.com)
08:19:41 × ubert quits (~Thunderbi@77.119.168.192.wireless.dyn.drei.com) (Ping timeout: 265 seconds)
08:19:42 ub is now known as ubert
08:19:51 <sm> my goal was fire and forget processes, that I can start and which disappear by themselves
08:20:06 × eggplantade quits (~Eggplanta@2600:1700:bef1:5e10:21fb:d4a:1e2:e3eb) (Ping timeout: 245 seconds)
08:20:08 <merijn> sm: You can poll using getProcessExitCode
08:20:29 <merijn> sm: That is fairly tricky on unix in general
08:20:44 max22- joins (~maxime@lfbn-ren-1-762-224.w81-53.abo.wanadoo.fr)
08:20:54 <sm> darn
08:20:55 <merijn> sm: I can shill my usual (entirely underrated and underread) book: Advanced Programming in the UNIX Environment, 3rd edition
08:20:56 <absence> merijn: thanks, i'll look into DefaultSignatures
08:21:17 <merijn> absence: Basically, those let you give a default implementation with a type signature that doesn't match the *real* signature
08:21:59 <merijn> absence: So, suppose you wanted "instance Show a => Foo a" (so a default version using Show), you'd instead have "class Foo a where ..." and then use Show on the default implemenation (via DefaultSignatures)
08:22:13 <maerwald> sm: all a zombie does is occupy a entry in the process table
08:22:32 <merijn> absence: That means that you can simply write "instance Foo MyData" and it will use the Show default implementation (assuming MyData has a Show instance)
08:22:39 ubert1 joins (~Thunderbi@178.165.181.201.wireless.dyn.drei.com)
08:22:49 <maerwald> in a long-running backend, you probably don't want that
08:22:53 <maerwald> otherwise it doesn't matter
08:23:03 <sm> maerwald: yes, and that is bad when you're playing a lot of sound effects.. after a while your system can't fork anything new :)
08:23:05 <merijn> absence: Since you explicitly define the instance, you avoid overlapping instances, but you don't have to write the actual implementation either
08:23:23 <merijn> absence: See, for example, https://github.com/merijn/validated-literals/blob/master/ValidLiterals.hs#L86-L88
08:23:44 <merijn> absence: Basically, if 'b' has a Lift instance you can just use the default implementation, if it doesn't, you have to write a custom one
08:25:11 <merijn> sm: tbh, you could just have a "spawn command and immediately wait" action and fork that into it's own forkIO thread and it should "Just Work (TM)" (assuming you use -threaded)
08:25:34 <merijn> sm: forkIO thread are cheap as hell, so you can easily afford 1 per sub-process
08:25:41 <sm> merijn, won't that thread hang around for the same reason ?
08:25:48 <sm> process.
08:25:55 <sm> thread ?
08:25:57 <sm> hmm
08:25:57 <noctux> if you call wait, noe
08:26:06 <noctux> because you collect the zombi with wait
08:26:09 <merijn> sm: forkIO threads are gced when they finish executing
08:26:24 <merijn> sm: So the thread will wait until the subprocess ends, then terminate
08:26:47 <merijn> You don't have to wait for GHC threads to get rid of them
08:27:09 <sm> that's exactly what I wanted. I think I even started out using forkIO, but switched to spawnCommand for some reason
08:27:43 <merijn> This should work fine without zombies: forkIO (spawnCommand "foo" >>= waitForProcess)
08:28:22 <merijn> Silently swallows all errors from subprocesses, but if that's fine, you're set
08:28:31 × hnOsmium0001 quits (uid453710@id-453710.hampstead.irccloud.com) (Quit: Connection closed for inactivity)
08:29:12 × azeem quits (~azeem@2a00:801:44b:8c08:deb2:1ae7:691a:354c) (Read error: Connection reset by peer)
08:30:12 azeem joins (~azeem@2a00:801:44b:8c08:deb2:1ae7:691a:354c)
08:31:26 <sm> (void . forkIO . void . waitForProcess <=< spawnCommand) ... works perfectly. Thanks! I would not have figured this out from docs.
08:31:57 <merijn> Don't need void before forkIO, I think?
08:31:59 <merijn> :t forkIO
08:32:01 <lambdabot> error: Variable not in scope: forkIO
08:32:08 × azeem quits (~azeem@2a00:801:44b:8c08:deb2:1ae7:691a:354c) (Read error: Connection reset by peer)
08:32:11 <merijn> % :t Control.Concurrent.forkIO
08:32:11 <yahb> merijn: IO () -> IO ThreadId
08:32:15 <merijn> ah, you do
08:32:21 azeem joins (~azeem@emp-85-170.eduroam.uu.se)
08:32:26 Gurkenglas joins (~Gurkengla@dslb-002-203-144-204.002.203.pools.vodafone-ip.de)
08:32:57 jgeerds joins (~jgeerds@55d4da80.access.ecotel.net)
08:33:16 <sm> actual code:
08:33:31 sm sent a haskell code block: https://libera.ems.host/_matrix/media/r0/download/libera.chat/6cd0955684e08aa5ba4bbc242241e0f13aab672f
08:33:54 × aegon quits (~mike@174.127.249.180) (Remote host closed the connection)
08:34:07 <maerwald> why not use `withCreateProcess`?
08:34:22 <merijn> Needs more bindings
08:34:32 <merijn> maerwald: Because he doesn't wanna wait for it to finish?
08:45:25 raehik joins (~raehik@cpc95906-rdng25-2-0-cust156.15-3.cable.virginm.net)
08:47:40 gehmehgeh joins (~user@user/gehmehgeh)
08:48:24 tdaeausr^ joins (~tdaeausr@70.166.66.234)
08:48:41 × cheater quits (~Username@user/cheater) (Ping timeout: 265 seconds)
08:51:31 × statusbot quits (~statusbot@ec2-34-198-122-184.compute-1.amazonaws.com) (Read error: Connection reset by peer)
08:51:40 statusbot joins (~statusbot@ec2-34-198-122-184.compute-1.amazonaws.com)
08:55:25 cheater joins (~Username@user/cheater)
08:57:47 × shriekingnoise quits (~shrieking@186.137.144.80) (Quit: Quit)
08:58:34 × tromp quits (~textual@dhcp-077-249-230-040.chello.nl) (Quit: My iMac has gone to sleep. ZZZzzz…)
09:00:56 <absence> merijn: hm, maybe i misunderstood how to use it, but i run into the same problem when using DefaultSignatures. if i want one implementation for types that have a Generic instance, and another for those that don't, i still end up with "Generic a => A a" (with uses the default implementation that depends on Generic) and "A a" (with explicit non-Generic implementation)
09:01:21 ph88 joins (~ph88@2a02:8109:9e00:7e5c::3d56)
09:01:36 tromp joins (~textual@dhcp-077-249-230-040.chello.nl)
09:02:06 <merijn> absence: You control the source of class 'A' yeah?
09:02:21 <merijn> can you pastebin the class and instance definition?
09:02:57 <merijn> absence: oh, wait, you use the default implementation and then define "instance Generic a => A a where ..."?
09:03:33 <merijn> absence: If you use DefaultSignatures you don't define "instane Generic a => A a" that will always be an overlapping mess and you can't fix that
09:04:24 <merijn> absence: The idea with DefaultSignatures is that you still define an instance for each individual type, you just never need to define an *implementation*, so "instance A Foo" becomes the entire complete code to make Foo an instance of A (since it can just use the default implementations)
09:04:52 <merijn> Downside: You need to write out "instance A Foo" for every type
09:04:57 <merijn> Upside: No overlapping clusterfuck
09:07:25 × MQ-17J quits (~MQ-17J@8.6.144.117) (Ping timeout: 252 seconds)
09:12:30 <absence> merijn: ahh i see! and then i have to write instances (with the same explicit implementation) for all the non-Generic types? instance A Int where f = nonGeneric, instance A String where f = nonGeneric, etc?
09:13:23 <merijn> absence: If they can't work with the default, yeah
09:13:30 × tzh quits (~tzh@c-24-21-73-154.hsd1.or.comcast.net) (Quit: zzz)
09:15:06 × wyrd quits (~wyrd@gateway/tor-sasl/wyrd) (Ping timeout: 276 seconds)
09:16:33 × azeem quits (~azeem@emp-85-170.eduroam.uu.se) (Read error: Connection reset by peer)
09:16:59 <absence> actually maybe lists do have a Generic instance, so String was a bad example. stuff like Int, Text, Bool, etc don't and can't use the default. it's going to be LOTS of instances for both Generic and non-Generic types it seems, which is what i was hoping to avoid to begin with
09:17:11 azeem joins (~azeem@emp-85-170.eduroam.uu.se)
09:17:53 <merijn> I'm not really sure how you'd end up in a situation where there is a single implementation that works for all non-Generics and another that works for all Generics
09:18:25 <merijn> What are you trying to accomplish that this is a problem
09:18:59 __monty__ joins (~toonn@user/toonn)
09:24:27 wyrd joins (~wyrd@gateway/tor-sasl/wyrd)
09:28:49 <absence> merijn: i have a bunch of records, defined outside my control, and containing sub-records inside Maybe, etc. for all the fields of a specific type (say Text) i want to do some validation, e.g. Text -> Either SomeError Text, but doing that manually would be very error-prone as the records change over time. i thought i could do it with Generic, but for each value i end up wanting to ask is the type Text?
09:28:55 <absence> validate. else does the value have a Generic instance? recurse over all fields and propagate the Either SomeError with traverse. else dummy-validate with "pure". as you can imagine, i'm having some problems expressing those questions to the compiler :)
09:29:44 <merijn> It's the same validation for all values of the same type?
09:29:56 <absence> yes
09:30:54 <merijn> Isn't that the kinda atrocity uniplate can simplify?
09:31:07 <sm> how would you silence stdout and stderr of just a particular callCommand or spawnCommand ?
09:31:32 <sm> I just relearned that https://hackage.haskell.org/package/silently is not the way, despite appearances
09:31:41 <absence> merijn: ooh, i had completely forgotten uniplate exists. you may be right!
09:31:48 <merijn> sm: silently is hacky as hell
09:31:58 <merijn> sm: You can't with spawnCommand
09:32:17 <merijn> sm: You'll have to use the CreateProcess interface
09:32:34 <lortabac> absence: if you use lens, there is also Control.Lens.Plated
09:32:36 <merijn> sm: By default children inherit stdin/stdout/stderr from their parent (i.e. your terminal)
09:32:44 <sm> merijn: well since the spawnCommand is in a forkIO child thread.. I thought I could do something in there
09:33:16 <merijn> sm: No, because it never goes to your Haskell code
09:33:25 <merijn> sm: The child process is just directly writing to the same terminal
09:33:32 <sm> woah
09:33:33 <merijn> sm: https://hackage.haskell.org/package/process-1.6.13.2/docs/System-Process.html#t:StdStream
09:33:53 <sm> merijn++, again you enlighten me
09:33:54 <merijn> the CreateProcess record lets you specify how to setup the stdin/stdout/stderr of the child process
09:34:02 <sm> thanks
09:34:04 epolanski joins (uid312403@id-312403.helmsley.irccloud.com)
09:34:50 <merijn> sm: You can open a read/write handle to /dev/null and pass that to swallow all output, alternatively you can use CreatePipe to get a handle to intercept output on and, say, log it or something
09:35:59 <sm> phew.. hard work to run things and ignore them
09:38:06 <maerwald> or just use the unix package
09:38:18 <merijn> sm: tbh, I like process, it's very solid and comprehensive, but it's best thought of as fairly low level. A lot of the "simple" things like spawnCommand are kinda limited in the real world. Generally I just end up writing a custom application specific wrapper around createProcess/withCreateProcess
09:38:36 <maerwald> process API is atrocious
09:38:39 <merijn> maerwald: I don't think anyone else in here besides you is principled enough to use unix correctly, tbh
09:38:47 <merijn> maerwald: How so?
09:38:54 <maerwald> I dunno, everything
09:39:07 lavaman joins (~lavaman@98.38.249.169)
09:39:11 <sm> maerwald: this needs to be cross platform, and I assume unix-compat won't do
09:39:20 <merijn> maerwald: Unix API is way worse, forkProcess is an insanely dangerous non-option
09:39:37 sm checks async
09:39:43 <maerwald> sm: here's what I do cross-platform: I write an abstraction that uses `unix` on unix and `process` on windows :p
09:39:55 <merijn> maerwald: You just gotta ignore the "high level" process API and only use createProcess/withCreateProcess
09:39:57 <arahael> I haven't tried the process api, but outside of haskell, the only "process" library I've liked has been... Python's subprocess module.
09:40:08 <arahael> (And I've used a *lot* of different systems and languages)
09:40:16 <merijn> arahael: The low level process API is fine and does exactly what you'd expect
09:40:18 × dschrempf quits (~dominik@070-207.dynamic.dsl.fonira.net) (Quit: WeeChat 3.3)
09:40:20 <sm> maerwald: any chance you have a robust forkAndIgnore ? :)
09:40:23 <ph88> how can i make with trifecta that if a line doesn't match it goes on to try the next line ? I can add the function `try` on my parser, but that doesn't forward it to the next line if it doesn't match i think
09:40:25 <arahael> merijn: That's good.
09:40:27 <merijn> The "high" level api is kinda bad, imo
09:40:37 <merijn> arahael: It simplifies things in invalid ways, imo
09:40:48 <arahael> merijn: What's not good are yeah, 'high level' api's that do magic. Python's subprocess has a very nice and elegant middle-of-the-line approach.
09:41:14 <arahael> Ruby's process stuff by contrast, are awful, imho.
09:41:16 <merijn> arahael: I mean: "createProcess :: CreateProcess -> IO (Maybe Handle, Maybe Handle, Maybe Handle, ProcessHandle)" as is straightforward you can get for posix processes
09:41:24 <arahael> Very nice.
09:41:26 <[exa]> ph88: you need alternative parser that eats the rest of the line
09:41:35 <merijn> arahael: Where CreateProcess is a record that handles all kinds of configuration like pipes, etc.
09:41:42 <arahael> I figured.
09:42:46 <arahael> merijn: What I particularly dislike are systems that try to provide a magical unix facade over windows.
09:42:47 <[exa]> ph88: parsix package is basically trifecta with sensible error recovery
09:43:01 × theproffesor quits (~theproffe@user/theproffesor) (Ping timeout: 245 seconds)
09:43:02 <[exa]> (suggest trying that out)
09:43:08 <merijn> maerwald: I mean, how do you even deal with subprocess at all using unix? forkProcess?
09:43:23 <maerwald> yeah
09:43:30 <merijn> I am 110% convinced not a single person on this planet is able to correctly and safely use forkProcess
09:43:43 <merijn> It's one of the most crazy/insanely dangerous functions in existence
09:43:47 × lavaman quits (~lavaman@98.38.249.169) (Ping timeout: 265 seconds)
09:44:13 theproffesor joins (~theproffe@2601:282:847f:8010::be7d)
09:44:13 × theproffesor quits (~theproffe@2601:282:847f:8010::be7d) (Changing host)
09:44:13 theproffesor joins (~theproffe@user/theproffesor)
09:44:22 <arahael> Just saw the docs: "forkProcess corresponds to the POSIX fork system call. " <-- That tells me everything I need to know.
09:44:27 <maerwald> you have to wiggle the code for a while and perform some dark shaman rituals, but it eventually works
09:44:30 <[exa]> merijn: implying there are people who can safely fork() with custom fd's open
09:45:11 <merijn> [exa]: Implying anyone can safely use fork at all
09:45:25 <merijn> maerwald: Incorrect. It will eventually *seem* to work
09:45:40 <maerwald> that's programming in general
09:45:46 <[exa]> :]
09:45:53 <merijn> [exa]: I don't understand how it's 2021 and people still think fork is a remotely sensible function/API
09:46:11 <merijn> Like, it's been superceded by posix_spawn for, like, 3 decades now
09:46:19 <merijn> The semantics are entirely unreasonable
09:46:31 <arahael> It was bad enough when it was mostly defined how fork(), followed immediately by exec(), was reasonable, but today even that is problematic.
09:46:32 <[exa]> merijn: it is, in a totally isolated usecase of a 300line C program that terminates in the first clone and execs in the second one
09:46:42 <maerwald> does unix even have spawn?
09:46:56 <merijn> maerwald: I dunno if unix has it, but that's a failure of unix if it doesn't
09:47:00 <arahael> maerwald: It has the various clone system calls.
09:47:18 <maerwald> I can't find it
09:47:23 <merijn> maerwald: posix_spawn is *old* by now and the recommended way of creating new processes
09:47:46 <merijn> But everyone still teaches fork, because we like damaging future programmers
09:48:08 <merijn> [exa]: I had a colleague come to me with weird concurrency issues
09:48:12 <merijn> Walk through the code
09:48:24 <arahael> maerwald: There's https://www.man7.org/linux/man-pages/man2/clone.2.html but I'd _still_ avoid it.
09:48:27 <merijn> "ok, so this is where we fork the new processes..."
09:48:41 <merijn> '!!! you exec immediately after, right?'
09:48:46 <merijn> "eh, no? Why?"
09:48:46 <arahael> Heh.
09:48:47 <[exa]> clone() is nicer but not sure how portable
09:48:55 <merijn> me: *sobbing*
09:48:59 <arahael> [exa]: That's the best thing about it! It's not portable. :D
09:49:04 <merijn> arahael: In a multi-threaded parallelised program too :(
09:49:05 <[exa]> lovable
09:49:19 <merijn> [exa]: posix_spawn is the portable way
09:49:19 <arahael> [exa]: But then, neither is fork().
09:49:50 <merijn> Incidentally, posix_spawn looks a lot like the Windows API
09:50:13 <arahael> merijn: And lovely. A decade ago I came to the conclusion that the only safe time to use fork and exec was at the very start of your program.
09:50:17 twitu joins (~twitu@223.236.227.132)
09:50:19 <maerwald> merijn: https://github.com/haskell/unix/issues/196
09:50:26 <merijn> Because the NT kernel was written by proper engineers and not insane cowboys >.>
09:50:48 <[exa]> arahael: I meant "at least to BSDs"
09:51:25 <arahael> [exa]: Ah, so you mean it in the same way Microsoft and Apple mean it when they say "portable".
09:51:30 <merijn> maerwald: You might hate on process' API, but at least the underlying process spawning makes a serious/robust attempt at being portable
09:51:33 <arahael> [exa]: Portable only to their particular preferred OS's.
09:51:58 <ph88> [exa], what is your experience with parsix ?
09:52:00 <merijn> maerwald: tbh, I think the main problem with the process API is that it has those "high level" operations and makes them seem reasonable
09:52:01 <[exa]> arahael: yeah, portable to unixes not portable to whatever software out there :D
09:53:11 <arahael> merijn: Just to clarify, which specific process API are you referring to in hackage?
09:53:12 <maerwald> https://hackage.haskell.org/package/process-1.6.13.2/docs/System-Process.html#v:readCreateProcessWithExitCode
09:53:19 <arahael> merijn: So that I can take note. :)
09:53:21 <maerwald> stdout and stderr as String
09:53:24 <maerwald> wow
09:53:34 <[exa]> ph88: not much honestly, I saw a project where it replaced trifecta, and it's got `withRecovery` so I assumed it could help you :]
09:53:42 <merijn> maerwald: Like I said, that API is bad
09:53:43 <maerwald> I had to copy paste large chunks of process and fix it in my own code
09:53:46 <merijn> maerwald: Just use createProcess
09:54:28 <arahael> Ah, so the createProcess in *that* process api. Yep, that one does look good.
09:54:38 <merijn> arahael: Anything that pretends returning result as string is reasonable
09:54:45 <ph88> [exa], i'm not sure what should be the return type for the alternative for a line that i want to skip. Like when i do some/many it will build up a list, but a skipped line i don't want in the list at all
09:55:07 <arahael> merijn: Hmm?
09:55:43 <merijn> arahael: those are bad, I mean :p
09:55:44 <[exa]> ph88: you need to represent the skip somehow; preferably just add `| SkippedLine` to your AST and remove that later?
09:55:50 <merijn> arahael: Really just anything in the "Simpler functions for common tasks
09:55:51 <arahael> merijn: Ok, now that makes sense. ;)
09:55:53 <merijn> " section
09:56:04 <merijn> besides cleanupProcess/withCreateProcess, which are fine
09:56:17 <[exa]> ph88: the other way would be to skip the line and recursively retry on the next one, returning actual data
09:56:32 <merijn> maerwald: If you just use createProcess directly, there isn't significantly more boilerplate than (attempting to use) forkProcess
09:56:49 <maerwald> except now I have to guess what the abstraction does
09:56:59 <ph88> [exa], thanks, i like that second option much better not creating uncessary data types
09:57:00 <merijn> maerwald: What abstraction?
09:57:11 <maerwald> `createProcess`
09:57:37 <merijn> maerwald: It spawns a process with stdin/stdout/stderr setup and give you those handles and a ProcessHandle
09:57:42 <merijn> maerwald: What is there to guess?
09:57:49 <maerwald> what does it do on windows?
09:57:53 <[exa]> ph88: actually it may be worse, it shifts the complexity from data (1 more alternative) to execution (so much possible backtracks if you reach EOF on retries)
09:57:56 <maerwald> what system calls it uses?
09:58:15 <[exa]> ph88: but well I have no idea what your usecase is, so either may be fine :D
09:58:15 <merijn> maerwald: it uses posix_spawn wherever available
09:58:48 <arahael> maerwald: See also https://hackage.haskell.org/package/process-1.6.13.2/docs/System-Process.html#t:CmdSpec
09:59:04 <arahael> maerwald: I just drilled down the types.
09:59:04 <maerwald> arahael: ?
09:59:08 <ph88> [exa], it shouldn't backtrack beyond 1 line o_O
09:59:20 <arahael> maerwald: That explains how some things are implemented.
09:59:38 <arahael> maerwald: (In terms of the sematnics on windows vs unix)
09:59:47 <arahael> *semantics
09:59:50 <[exa]> ph88: yeah, just take care about that :]
09:59:52 <maerwald> is says "execvp semantics is used"... when I grep the code there's all sorts of C wrappers
09:59:53 <ph88> [exa], how can i test if a parser succeeded from within the parser code so i know i have to recursively try again ?
10:00:02 <maerwald> I'm not sure what it really does unless I read all of the code
10:00:21 <[exa]> do you guys discuss CreateProcess, CreateProcessEx, CreateProcessAsUser, CreateProcessWithLogonEx, or CreateProcessA2 ?
10:00:44 <arahael> maerwald: I'm not sure I follow your line of thought, there, then.
10:01:02 <[exa]> oh it's the haskell createProcess
10:01:07 <merijn> maerwald: That logic applies to literally every library ever
10:01:07 <[exa]> I was getting confused. :D
10:01:15 <maerwald> arahael: https://github.com/haskell/process/blob/master/cbits/win32/runProcess.c
10:01:27 <maerwald> https://github.com/haskell/process/blob/master/cbits/posix/posix_spawn.c
10:01:37 <arahael> maerwald: Yeah, well, I'm just looking at the (quite good) docs here.
10:01:50 <arahael> maerwald: I'd hope I don't need to read all the implementation.
10:01:53 <maerwald> merijn: well, there are primitives and then there are abstractions
10:01:59 <merijn> maerwald: What, exactly, is your complaint
10:02:07 <maerwald> it's an abstraction, not primitives
10:02:32 <merijn> maerwald: If you want primitives you can trivially directly call those via the FFI, so why even use any library at all
10:02:48 <maerwald> yeah, `unix` does the bindings for me
10:03:02 <merijn> unix also does a bunch of wrapping
10:03:08 <merijn> maerwald: What does fork do, for example?
10:03:20 <merijn> maerwald: It very obviously (looking at the code) doesn't directly call fork
10:03:29 <merijn> So you don't know what those wrappers are doing either
10:03:50 <maerwald> merijn: I think those wrappers have usually two reasons 1. avoid using CApi (a wrapper will have a similar effect) and 2. interaction with RTS?
10:04:38 <merijn> maerwald: Ok, please explain me exactly what forkProcess does, according to you
10:04:45 <maerwald> lol
10:04:53 <merijn> Besides introducing a billion potential deadlocks
10:05:28 <merijn> maerwald: I'm serious. I used forkProcess in the past, I'd studied the unix code and I *literally* can't tell what it does
10:05:44 DNH joins (~DNH@2a02:8108:1100:16d8:31ac:ed04:1cbf:a354)
10:06:45 × Vajb quits (~Vajb@hag-jnsbng11-58c3a8-176.dhcp.inet.fi) (Read error: Connection reset by peer)
10:07:29 <merijn> maerwald: As far as I can tell, it create a stable pointer to an IO action, then forks the process into a (potentially wildly invalid, incoherent) state where it then attempts to execute the IO
10:07:35 Vajb joins (~Vajb@hag-jnsbng11-58c3a8-176.dhcp.inet.fi)
10:08:37 Pickchea joins (~private@user/pickchea)
10:08:47 <merijn> maerwald: https://github.com/haskell/unix/blob/4291a5bf644449b57bb1d6e8c75ef582c09a8803/System/Posix/Process/Common.hsc#L300 <- what's this do?
10:08:52 <maerwald> you just make a point why posix_spawn is better, not why I should use the process package
10:08:53 <merijn> It's clearly *not* fork
10:09:14 <merijn> maerwald: Well, feel free to use posix_spawn directly
10:09:14 <maerwald> sure, I want better primitives
10:09:33 <maerwald> but I don't want cloudy API that's neither primitives, nor a good abstraction
10:09:37 <merijn> maerwald: Because process handles the boilerplate of using posix_spawn so I don't have to
10:10:00 <merijn> maerwald: The createProcess is minimal posix_spawn boilerplate, tbh
10:10:08 × Vajb quits (~Vajb@hag-jnsbng11-58c3a8-176.dhcp.inet.fi) (Read error: Connection reset by peer)
10:10:18 Vajb joins (~Vajb@hag-jnsbng11-58c3a8-176.dhcp.inet.fi)
10:10:38 <maerwald> if your documentation starts with "On unix..." then you already have no abstraction, but a dual-primitive
10:11:29 <maerwald> "it does something roughly similar on other platforms"
10:13:12 <maerwald> if you have a specific use case... such a thing can be reasonable... but as a library? not sure
10:13:53 <arahael> maerwald: From what I saw of those types I referred earlier, what's the problem with windows/
10:14:05 <arahael> maerwald: I mean, what's wrong with these abstractions that are preventing you from using them?
10:14:10 <merijn> maerwald: The irony is that you complain about this, but the unix API you advocate instead is actively worse in *literally* every way
10:14:35 <maerwald> arahael: I didn't say something is wrong
10:14:46 <maerwald> you sound like I have to prove a bug here
10:14:52 <merijn> It's fine to think the process API *should* be better, but don't pretend unix isn't infinitely worse
10:14:53 <maerwald> that wasn't the point
10:15:22 <merijn> maerwald: Well, if it wasn't, why did you tell someone to use unix instead? :p
10:15:43 <merijn> Or are you in the habit of recommending worse alternatives? :p
10:15:43 <maerwald> because then you clearly see what primitives you depend on
10:15:50 <merijn> Except you can't...
10:15:58 <merijn> Because nobody knows wtf forkProcess does
10:16:07 <merijn> I literally can't even find the C code for it in the unix repo
10:16:31 <maerwald> again: you're just saying there are better primitives
10:16:46 <merijn> maerwald: No, forkProcess *isn't even a primitive*
10:16:50 <maerwald> `process` doesn't even expose them
10:17:12 <sm> I believe I've done it, using typed-process
10:17:13 sm sent a haskell code block: https://libera.ems.host/_matrix/media/r0/download/libera.chat/ae7de1c81f698a64dfe8efc29973da02fd9c46ec
10:17:41 <merijn> maerwald: Neither does unix
10:18:29 × azeem quits (~azeem@emp-85-170.eduroam.uu.se) (Ping timeout: 268 seconds)
10:19:36 <arahael> I just tried to use forkProcess in C: int main() { forkProcess(); }
10:19:39 <arahael> Failed to link.
10:20:07 <merijn> arahael: I think it's foreign import of a GHC primitive
10:21:11 <merijn> arahael: Although there's no forkProcess in base docs either, so who knows what the hell it's really calling
10:21:33 <arahael> merijn: And it's not defined anywhere in the haskell compiler?
10:23:03 azeem joins (~azeem@2a00:801:44b:8c08:deb2:1ae7:691a:354c)
10:23:29 × azeem quits (~azeem@2a00:801:44b:8c08:deb2:1ae7:691a:354c) (Read error: Connection reset by peer)
10:23:29 <maerwald> https://gitlab.haskell.org/ghc/ghc/-/blob/481e6b546cdbcb646086cd66f22f588c47e66151/rts/Schedule.c#L2022
10:24:22 <maerwald> those are shenanigans due to GHC rts I think
10:25:00 azeem joins (~azeem@emp-85-170.eduroam.uu.se)
10:25:13 kuribas joins (~user@ptr-25vy0i8rjj87ltkm4em.18120a2.ip6.access.telenet.be)
10:25:22 <maerwald> and that doesn't seem like an abstraction, rather than a necessity
10:26:13 <arahael> maerwald: Notice how it's deliberately holding all the locks it knows about?
10:26:42 <arahael> maerwald: And consider what that means for any other library you might happen to have loaded into your process whose locks did not get held.
10:29:55 <absence> merijn: it seens like uniplate is more focused on type constructors of a sum type than on record fields, so i'm not sure if it's possible to e.g. apply a transformation to all fields of type Text?
10:31:16 <maerwald> https://github.com/haskell/process/blob/e448450049ac51a6fcd5d1f0be86448d0931d71a/cbits/posix/posix_spawn.c#L202
10:31:26 <maerwald> not sure why this isn't in `unix` package
10:31:45 jinsun__ joins (~quassel@user/jinsun)
10:33:11 × max22- quits (~maxime@lfbn-ren-1-762-224.w81-53.abo.wanadoo.fr) (Remote host closed the connection)
10:33:51 max22- joins (~maxime@lfbn-ren-1-762-224.w81-53.abo.wanadoo.fr)
10:33:58 × geekosaur quits (~geekosaur@xmonad/geekosaur) (Remote host closed the connection)
10:35:22 × jinsun quits (~quassel@user/jinsun) (Ping timeout: 252 seconds)
10:38:19 geekosaur joins (~geekosaur@xmonad/geekosaur)
10:39:10 <sm> as a respite from the horrors of process management, here's my little WIP game:
10:39:10 <sm> https://github.com/simonmichael/games/tree/main/caverunner
10:45:53 <maerwald> sm: what's your highscore?
10:46:20 jacks2 joins (~bc8165b6@199.204.85.195)
10:46:21 <jacks2> hi
10:46:28 <jacks2> can I do something like this with sortOn?
10:46:29 <maerwald> https://imgur.com/NuYtc92.png
10:46:40 <jacks2> > sortBy (comparing length <> compare) ["bb", "aaaa", "bbbb", "aa"]
10:46:42 <lambdabot> ["aa","bb","aaaa","bbbb"]
10:46:46 <sm> maerwald: glad you asked! currently trying to beat cave 1 at speed 20, high score is 449
10:46:49 jakalx parts (~jakalx@base.jakalx.net) (Error from remote client)
10:47:00 <maerwald> x(
10:47:19 <sm> I had a session where I was just beating them all at speed 15. But that was some kind of weird anomaly
10:51:07 <sm> 450 🤣
10:51:47 <maerwald> you're cheating
10:52:06 o1lo01ol1o joins (~o1lo01ol1@2001:8a0:6d7a:df01:e9a1:1385:aea9:e3d1)
10:52:27 <sm> practicing!
10:52:37 <arahael> That game looks fun.
10:53:17 <sm> I would be glad to hear of any setup/gameplay (sound) issues on other machines (old ones, windows..)
10:53:38 <maerwald> I had to fix the shebang header so it doesn't use stack :p
10:54:11 tcard_ joins (~tcard@p2878075-ipngn18701hodogaya.kanagawa.ocn.ne.jp)
10:54:37 × Flonk quits (~Flonk@ec2-52-40-29-25.us-west-2.compute.amazonaws.com) (Quit: Ping timeout (120 seconds))
10:54:37 × tcard quits (~tcard@p2878075-ipngn18701hodogaya.kanagawa.ocn.ne.jp) (Read error: Connection reset by peer)
10:54:54 <sm> nod, I'll provide more instructions for folks who won't install stack later
10:55:02 <arahael> stack is still installing.
10:55:04 Flonk joins (~Flonk@ec2-52-40-29-25.us-west-2.compute.amazonaws.com)
10:55:05 × Cale quits (~cale@72.139.192.117) (Read error: Connection reset by peer)
10:55:07 <sm> it's hard to make it just work for both stack/non-stack people
10:55:24 <sm> arahael: slow to install, noted.. how are you installing it ?
10:56:05 <arahael> sm: The documented way. curl -sSL https://get.haskellstack.org/ | sh
10:56:28 <maerwald> arahael: ahah
10:56:30 <sm> what's taking the time ? downloading stack ?
10:56:37 <maerwald> arahael: I have a patch for cabal
10:56:45 <arahael> sm: Installing it.
10:56:52 <arahael> sm: The download was just a hundred MB or two or three.
10:57:02 <maerwald> arahael: https://paste.tomsmeding.com/c06MnidK
10:57:04 <maerwald> apply that
10:57:16 <sm> I think you're running the script by now, and the slowness is stack installing ghc ?
10:58:01 <arahael> Ah, yes, indeed, but the script had to install ghc and everything.
10:58:12 <arahael> maerwald: A bit late, but I'll keep that patch for reference. :)
10:58:18 <arahael> Oh, and now it says "game over".
10:58:25 × jgeerds quits (~jgeerds@55d4da80.access.ecotel.net) (Ping timeout: 260 seconds)
10:58:36 <sm> yes, that part is definitely slow (and I have silenced the progress output)
10:58:37 <maerwald> stack or the game xD
10:59:07 <arahael> Ok, first attempt: caverunner! ## cave 1 @ 15 high score 0268 ###### score 0268 #### speed 15
10:59:18 <maerwald> you're last
10:59:50 <arahael> maerwald: I prefer to think of myself as have come... third here, or something like that. :)
10:59:59 <sm> nice! :)
11:00:12 × merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 268 seconds)
11:00:25 <sm> needs a real-time highscore server
11:01:21 <maerwald> now write a successor of https://crawl.develz.org/
11:01:24 <ph88> Could someone help me understand this type error ? https://bpa.st/Y4MA
11:01:26 merijn joins (~merijn@83-160-49-249.ip.xs4all.nl)
11:01:45 <arahael> maerwald: I'm trying your version, the cabalified one. :)
11:02:30 × xff0x quits (~xff0x@2001:1a81:524d:6800:a178:5c71:40d3:e997) (Ping timeout: 260 seconds)
11:02:34 <arahael> maerwald: I notice it uses process. ;)
11:02:42 <maerwald> arahael: =(
11:02:56 <sm> maerwald: that's LamdaHack & Allure of the Stars
11:03:06 <sm> LambdaHack
11:03:38 <sm> typed-process
11:05:05 <arahael> Hmm, difference between cabal and stack for these one-line scripts... I think I'd have to go with stack - the first time I tried this, I wasn't up to date so cabal just simply failed to find the packages.
11:05:20 <arahael> I do prefer cabal, though, somehow.
11:05:28 <oak-> ph88: I guess this calls for a need of FunctionalDependencies
11:05:38 <ph88> how so ?
11:05:58 peterhil joins (~peterhil@dsl-hkibng32-54fb52-57.dhcp.inet.fi)
11:07:11 <oak-> or this might be the case, I didn't read the code very throughfully yet
11:07:32 × Cajun quits (~Cajun@user/cajun) (Quit: Client closed)
11:08:58 xff0x joins (~xff0x@2001:1a81:524d:6800:a178:5c71:40d3:e997)
11:10:07 <sm> maerwald, arahael do you think terminal games like this are a good fit for ghcjs ?
11:10:28 <oak-> but I encountered similar kind of thing when playing with MultiParamTypeClasses not so long ago
11:10:30 <arahael> sm: I don't think so - why?
11:10:43 <arahael> sm: You mean for the browser?
11:11:00 <__monty__> Would be pretty cool to be able to try them out without installing/building anything.
11:11:07 × hololeap_ quits (~hololeap@user/hololeap) (Remote host closed the connection)
11:11:08 <sm> exactly
11:11:11 <__monty__> Having to install GHC is a pretty big hurdle.
11:11:22 <sm> now that I think of it, LambdaHack/Allure do it
11:11:45 <arahael> So, for the browser, then? That would work.
11:11:50 × merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 260 seconds)
11:11:58 <arahael> But I definitely wouldn't want to install it myself, and it would discourage me from modifying it.
11:12:06 <sm> if it's in the browser, there's a chance I could share games with family
11:12:21 <arahael> sm: The other option is to provide a shell for it.
11:12:32 × azeem quits (~azeem@emp-85-170.eduroam.uu.se) (Ping timeout: 268 seconds)
11:12:38 hololeap_ joins (~hololeap@user/hololeap)
11:12:39 <maerwald> don't say nix-shell, because then I wouldn't want to install it :
11:12:44 merijn joins (~merijn@83-160-49-249.ip.xs4all.nl)
11:13:08 <arahael> sm: Eg, what they do in #hardfought: ssh hardfought.org
11:13:13 <sm> lol good work maerwald , nip that in the bud
11:13:40 xiongxin joins (~quassel@113.116.224.79)
11:13:48 <arahael> maerwald: Ha. I've been working on a PR for documentation, and I've had to study *arcane bash* for it.
11:14:17 <arahael> maerwald: For nix-shell. :)
11:14:27 <sm> arahael: no visible download or install info on that page
11:14:43 <maerwald> ph88: what's the expected type signature of `go`?
11:14:58 <arahael> sm: Did you miss the ssh bit? :)
11:15:13 Cajun joins (~Cajun@user/cajun)
11:15:18 <ph88> maerwald, f [Line] i think
11:16:01 <maerwald> ph88: well... if you remove the offending line and add a type hole to the sig, you get `[Line] -> [Line]`
11:16:04 <sm> arahael: yes. It's very small. So you were saying, serve it over ssh ? Good idea, I never thought of that
11:16:25 <maerwald> `fmap (:) (pure line) go` looks odd
11:16:28 sm was thinking "shell" = Electron or some such
11:16:33 o1lo01ol_ joins (~o1lo01ol1@2001:8a0:6d7a:df01:e9a1:1385:aea9:e3d1)
11:16:36 <arahael> sm: Yep!
11:16:41 azeem joins (~azeem@2a00:801:44b:8c08:deb2:1ae7:691a:354c)
11:16:55 <ph88> maerwald, ye it does .. didnt know how else to write it o_O
11:17:06 × azeem quits (~azeem@2a00:801:44b:8c08:deb2:1ae7:691a:354c) (Read error: Connection reset by peer)
11:17:09 <maerwald> start with the type signature you want
11:17:22 <ph88> ok
11:18:10 azeem joins (~azeem@emp-85-170.eduroam.uu.se)
11:18:12 <arahael> sm: Yeah, I gave the command, and you were then saying "nothing on that page", and I was thinking... "page"? :D
11:19:12 <maerwald> ph88: I got it
11:19:27 ph88 listening attentively :p
11:19:28 <maerwald> https://paste.tomsmeding.com/KFVG50x0
11:19:34 <ph88> thanks ! i'll check it out
11:19:42 × lisq quits (~quassel@lis.moe) (Quit: lisq)
11:20:01 <arahael> sm: That said, most people will find a website _familiar_.
11:20:13 × xiongxin quits (~quassel@113.116.224.79) (Read error: Connection reset by peer)
11:20:15 <dminuoso> ph88: Add more type signatures
11:20:27 <maerwald> ph88: `go` is already of the Parser type, so you just fmap into the parser and prepend the line
11:20:41 <maerwald> `fmap (:) (pure line) go` makes no sense imo
11:20:46 × o1lo01ol1o quits (~o1lo01ol1@2001:8a0:6d7a:df01:e9a1:1385:aea9:e3d1) (Ping timeout: 268 seconds)
11:20:47 × o1lo01ol_ quits (~o1lo01ol1@2001:8a0:6d7a:df01:e9a1:1385:aea9:e3d1) (Ping timeout: 240 seconds)
11:21:11 xiongxin joins (~quassel@113.116.224.79)
11:21:15 <maerwald> so it's not the `manyTill` line that's wrong... it's just the type inference falling flat
11:21:39 <ph88> wow that's weird it doesn't compile without the type signature on `go`
11:21:52 rond_ joins (~rond_@2a02:a31a:a23c:f480:2fd7:e087:5546:a438)
11:21:52 <dminuoso> ph88: Next time you have a type error where GHC infers things that seem silly, just add more type signatures. It's important to constraint inference from having mistaken inferenced type go too far
11:21:56 lis joins (~quassel@lis.moe)
11:22:25 <ph88> ye i was trying that on the maybeLine but i could do more places
11:22:32 <maerwald> especially since you didn't use `go` anywhere (except recursively)
11:26:31 <sm[i]> arahael: oops, I didn't even see your command, just jumped to hardfought.org :)
11:26:45 <maerwald> sm[i]: electron?
11:26:54 <maerwald> you want to ship an entire browser with your game?
11:27:17 <arahael> maerwald: I think sm's suggesting literally serve it himself and tell his family to hit the website in their browser.
11:27:46 <arahael> maerwald: And it makes sense; they already have a browser.
11:28:15 <maerwald> but electron ships with its own browser :p
11:28:37 <maerwald> every app is a browser, essentially
11:29:00 <sm[i]> maerwald, we can forget electron, I was just misunderstanding what arahael was saying. I'd like a way to put the game in a web page, like https://lambdahack.github.io
11:29:51 <maerwald> ah
11:29:59 <maerwald> well, just use the library then?
11:30:08 × xiongxin quits (~quassel@113.116.224.79) (Ping timeout: 265 seconds)
11:30:21 xiongxin joins (~quassel@113.116.224.79)
11:30:40 <arahael> sm[i]: That's what I thought you were saying, and I was suggesting maybe host it on ssh instead. That lambdahack.github.io looks like a nice idea, but it doesn't display correctly on my system.
11:30:46 <arahael> sm[i]: Display's weirdly wide and truncated here.
11:30:56 <maerwald> that might be "correctly" :D
11:31:20 <arahael> Ha. And it's hard to read. Very hard to read.
11:31:31 <maerwald> it's retro roguelike
11:31:49 <arahael> maerwald: I'm playing nethack at the moment, on ssh! It's nothing like that.
11:32:16 <sm[i]> fonts for roguelikes are apparently a really hard thing (Man of Letters knows)
11:33:17 <Cajun> what makes rougulike fonts difficult?
11:33:37 <arahael> sm[i]: Eh, just regular fixed-width fonts, really.
11:33:42 × rond_ quits (~rond_@2a02:a31a:a23c:f480:2fd7:e087:5546:a438) (Quit: Client closed)
11:33:55 <maerwald> it looks fixed-width
11:34:21 <sm[i]> I don't know all the details, I think it's that chars need to be square for layout and movement and square letters are hard to read
11:34:47 <sm[i]> (for starters)
11:35:28 <arahael> sm[i]: Definitely doesn't need to be square. Have you tried 'ssh hardfought.org'? :)
11:36:00 <merijn> I was about to say, most fixed-width fonts aren't square and nethack works fine...
11:36:02 o1lo01ol1o joins (~o1lo01ol1@bl13-86-242.dsl.telepac.pt)
11:36:10 × cfricke quits (~cfricke@user/cfricke) (Quit: WeeChat 3.3)
11:36:25 <sm[i]> ManofLetters[m] can explain better than I
11:36:45 <maerwald> I think it gives it a medieval vibe
11:37:15 <sm[i]> maybe he wanted accurate diagonals but nethack players don't care/are used to tall chars
11:37:32 × tdaeausr^ quits (~tdaeausr@70.166.66.234) (Remote host closed the connection)
11:39:08 <maerwald> it looks like it took a while to code :D
11:39:33 rond_ joins (~rond_@2a02:a31a:a23c:f480:2fd7:e087:5546:a438)
11:40:36 <sm[i]> maerwald, my thing ? 80h and counting :(
11:40:47 <maerwald> I mean the game engine
11:41:00 <sm[i]> ansi-terminal-game ?
11:41:05 <maerwald> LambdaHack
11:41:24 <sm[i]> oh, never mind. Yes I bet.
11:42:00 × twitu quits (~twitu@223.236.227.132) (Quit: Client closed)
11:45:13 × o1lo01ol1o quits (~o1lo01ol1@bl13-86-242.dsl.telepac.pt) (Ping timeout: 252 seconds)
11:52:47 o1lo01ol1o joins (~o1lo01ol1@bl13-86-242.dsl.telepac.pt)
11:53:57 × max22- quits (~maxime@lfbn-ren-1-762-224.w81-53.abo.wanadoo.fr) (Ping timeout: 265 seconds)
11:54:06 cfricke joins (~cfricke@user/cfricke)
11:55:31 × berberman quits (~berberman@user/berberman) (Quit: ZNC 1.8.2 - https://znc.in)
11:55:51 berberman joins (~berberman@user/berberman)
11:56:30 × tromp quits (~textual@dhcp-077-249-230-040.chello.nl) (Quit: My iMac has gone to sleep. ZZZzzz…)
12:00:16 × Cajun quits (~Cajun@user/cajun) (Quit: Client closed)
12:00:38 × o1lo01ol1o quits (~o1lo01ol1@bl13-86-242.dsl.telepac.pt) (Ping timeout: 268 seconds)
12:01:12 <arahael> sm[i]: Just been reading your game implementation a bit, the main thing I'm noting is the 'if' statmenets, those are multiway ifs, right?
12:01:23 <sm[i]> correct!
12:01:26 <sm[i]> I like them
12:01:58 <arahael> They do seem somewhat elegant. :)
12:02:05 <sm[i]> but I wish we didn't have = vs ->
12:02:08 <arahael> Particularly when there's a lot of logic.
12:02:20 <arahael> No, I like the difference between = and ->
12:02:27 <sm[i]> I am always getting it wrong
12:03:13 × bitdex_ quits (~bitdex@gateway/tor-sasl/bitdex) (Quit: = "")
12:03:26 × Pickchea quits (~private@user/pickchea) (Ping timeout: 245 seconds)
12:03:51 <arahael> Actually, now that you mention it, there is an inconsistency there.
12:04:02 <hpc> is there?
12:04:03 ski . o O ( using `=' for case branches, or `->' for defining equations, is just wrong )
12:04:04 <arahael> I mean, defining a function: foo bar baz = ...
12:04:11 <arahael> As opposed to: foo bar baz -> ...
12:04:22 <hpc> no, = is correct there
12:04:31 <hpc> definitions of functions use equational reasoning
12:04:31 <ski> (e.g. Erlang does `foo(Bar,Baz) -> ...' :/ )
12:04:44 <hpc> "foo bar baz" is actually equal to the rhs
12:04:49 <arahael> hpc: Even when you're defining various patterns?
12:04:56 <hpc> even then
12:04:57 <ski> arahael : yes
12:05:19 <ski> (modulo some inputs being handled by earlier matching equations)
12:05:24 <arahael> And why is that different to: case foo of ... -> stuff?
12:05:39 <ski> in `case ... of Just x -> print x', `Just x' is not equal to `print x'
12:05:44 <arahael> Mind you, there's no function /name/ there, that's the bit that gets assigned, imho.
12:05:48 <hpc> say you wrote case foo of {Nothing -> 5; Just _ -> 10}
12:05:51 <ski> they're even of different types
12:05:57 <hpc> there's no way that Nothing is equal to 5
12:06:17 <arahael> Well, `foo bar baz = ...` is effectively assigning to *foo*, but the rest of it is a pattern match, isn't it?
12:06:28 <merijn> arahael: It's not assigning
12:06:34 <merijn> arahael: It's stating equality
12:07:09 <arahael> Ah, and <- is "assignment".
12:07:20 <merijn> Well, I don't agree
12:07:23 <hpc> <- is syntax sugar, but that's a whole other thing
12:07:47 <ski> `case foo of {Nothing -> 5; Just _ -> 10}' is of course equivalent to `(\case {Nothing -> 5; Just _ -> 10}) foo' .. in SML, that's written `(fn NONE => 5 | SOME _ => 10) foo' (`fn' being lambda in SML, which was multi-way from the start), which is what `case foo of NONE => 5 | SOME _ => 10' is defined as sugar for
12:08:07 <arahael> To be honest, it's 11pm so I'm half asleep, but I was trying to appeal to sm's point of view that those symbols can be confusing.
12:09:34 talismanick joins (~talismani@76.78.246.30)
12:09:35 <ski> i'd suggest that that confusion then likely corresponds to a confusion (conflation ?) of defining equations vs. case branches (perhaps also involving other notions like "assignment")
12:09:48 <talismanick> Just tried moving my Haskell setup to a new computer
12:09:58 <talismanick> Installed everything from the other computer's package list
12:10:00 × jacks2 quits (~bc8165b6@199.204.85.195) (Quit: CGI:IRC (Error))
12:10:15 <merijn> talismanick: which package list would that be?
12:10:17 <geekosaur> package databases do not move well
12:10:18 <talismanick> but "cabal install brittany" still mysteriously fails on compiling aeson
12:10:26 jacks2 joins (~bc8165b6@199.204.85.195)
12:10:36 <jacks2> arahael foo bar baz = ... is syntax sugar for foo = \bar -> \baz -> ...
12:10:44 <talismanick> merijn: I'm not sure what you mean? I just echo'd all the packages I have installed via the system package manager.
12:10:44 <merijn> talismanick: Well, which version of GHC and cabal-install do you have on the old and new machines?
12:10:47 <talismanick> into a file
12:10:54 <arahael> jacks2: Yes, I'll agree with that, perhaps I should've lead with that.
12:11:05 <talismanick> merijn: Both are the latest, installed via ghcup
12:11:07 <merijn> talismanick: Just checking that you weren't talking about GHC's package list
12:11:30 <merijn> talismanick: What
12:11:36 <merijn> talismanick: What's the error aeson gives?
12:11:55 <talismanick> Let me find that log again....
12:11:59 <maerwald> maybe the aeson 2 bump
12:12:16 <merijn> maerwald: I was betting on some broken version bounds
12:12:21 <talismanick> Although, I will say: I haven't recompiled britanny in a while
12:12:23 <maerwald> they look good
12:12:24 o1lo01ol1o joins (~o1lo01ol1@bl13-86-242.dsl.telepac.pt)
12:12:31 <merijn> maerwald: On which package? :p
12:12:34 <talismanick> so it's possible it'd fail if I was trying from scratch again on this machine
12:12:35 <maerwald> brittany
12:12:40 <maerwald> it will force aeson <1.6
12:13:31 unit73e joins (~emanuel@2001:818:e8dd:7c00:32b5:c2ff:fe6b:5291)
12:13:47 <unit73e> hello
12:13:47 <talismanick> https://0x0.st/-kW4.log
12:13:51 × gehmehgeh quits (~user@user/gehmehgeh) (Ping timeout: 276 seconds)
12:14:01 <maerwald> ?
12:14:07 <maerwald> where's the error
12:14:09 <talismanick> maerwald: You are indeed correct. It's trying to build Aeson 1.5.6.
12:14:20 <talismanick> maerwald: See, that's the part which confuses me.
12:14:35 <geekosaur> unit73e, hello
12:14:36 <talismanick> (otherwise, I'd have Google'd it first and hopefully resolved it before resorting to IRC)
12:14:46 <unit73e> are lens used often nowadays? because I probably need to learn more about that
12:14:49 <maerwald> I can't follow
12:14:52 <talismanick> It just silently failed on aeson and said "go look at the logs"
12:14:57 <talismanick> "compilation failed"
12:15:07 <geekosaur> unit73e, some people love lens, others of us avoid it
12:15:26 <talismanick> I suppose I could try compiling again and piping stderr to a logfile of its own to show that I'm telling the truth
12:15:32 <geekosaur> it has its uses, but when overused it can mjake code *very* hard to read (imo)
12:15:41 tromp joins (~textual@dhcp-077-249-230-040.chello.nl)
12:15:44 <maerwald> try `cabal repl --build-depends aeson --constraint 'aeson == 1.5.6.0'`
12:15:54 <merijn> unit73e: It depends who you ask
12:16:02 <unit73e> geekosaur, ok. not a bad idea to learn more about it either way. the package doc seems good enough. kind of looks like the get/set of Java.
12:16:09 <geekosaur> yes
12:16:35 <geekosaur> also there is optics, which does much the same thing but provides better error messages (at the price of not being as easily extensible)
12:16:57 <geekosaur> so you might want to start with optics first and nmove on to lens later
12:17:03 <talismanick> I thiiiiiink I might be missing a distro package, though
12:17:19 <unit73e> ok thanks geekosaur . I'll do that.
12:17:25 <talismanick> because Void, like some other distros, splits packages between "packagename" and "packagename-devel"
12:17:33 <unit73e> merijn, it does look kind of weird compared to everything else
12:17:37 <unit73e> but that's just me
12:17:48 <merijn> unit73e: I still rarely use lens
12:18:07 <merijn> Don't think I've written more, than, 20 or so lines with it in the past decade :p
12:18:09 <geekosaur> right, that's why I said "imo" and specified that some people love it and others avoid it
12:18:11 <talismanick> where you don't install -devel onto a system permanently, if at all possible, because they're meant to be installed inside ephemeral build containers
12:18:35 <geekosaur> there's no one right answer and a lot of personal taste involved
12:18:38 <unit73e> I'm still working on SDL2 lazyfoo port btw: https://gitlab.com/unit73e/lazyfoo-examples
12:18:46 <merijn> geekosaur: Yes there is. Mine! :p
12:18:51 <talismanick> but I have several -devel files installed anyways because I can't be arsed to figure out how to containerize all my Haskell compilations without breaking everything.
12:18:54 <unit73e> but I got to a point were I noticed lazyfoo does things in a weird way
12:19:01 <unit73e> the move lesson is god awful
12:19:09 <merijn> talismanick: That sounds like terrible distro design, tbh
12:19:12 <talismanick> (e.g. I need file-devel, or else GHC won't compile - I don't know why)
12:19:15 <unit73e> so I'm starting to make my own examples
12:19:38 <maerwald> merijn: 90% of binary distros do that
12:19:44 eggplantade joins (~Eggplanta@2600:1700:bef1:5e10:21fb:d4a:1e2:e3eb)
12:19:52 <talismanick> It does actually cut down on a lot of bloat
12:19:56 <merijn> maerwald: Well, >90% of linux distros are terrible, so that sounds about right :)
12:20:03 <maerwald> no
12:20:06 <maerwald> 100%
12:20:22 <talismanick> e.g. I once installed cairo-devel (to compile a C binary outside of the package manager), and it pulled down >20 other packages
12:20:26 <merijn> maerwald: I was just hedging on the possibility of a hypothetical distro I don't hate existing :p
12:20:57 <geekosaur> it's called freebsd :þ
12:21:03 <maerwald> ahahaha
12:21:04 <merijn> I wish the 386BSD lawsuit never happened and we lived in a version of the world where BSD dominated
12:21:06 <unit73e> basically lazyfoo did the motion moves a dot in 10 pixels with you press an arrow key. most games don't do that... anyway I got to a point were I understand SDL2 so might as well make my own examples
12:21:08 <merijn> geekosaur: Yes
12:21:45 <arahael> merijn: Only one 9? :)
12:21:47 × sagax quits (~sagax_nb@user/sagax) (Quit: Konversation terminated!)
12:21:49 <maerwald> FreeBSD, where you have two versions of one library installed and they interact weird with one another and break GHC
12:21:59 × o1lo01ol1o quits (~o1lo01ol1@bl13-86-242.dsl.telepac.pt) (Ping timeout: 265 seconds)
12:22:24 <merijn> maerwald: Sounds like user error
12:22:35 <maerwald> FreeBSD is a user error
12:22:38 <maerwald> :D
12:22:41 <geekosaur> sounds like iconv to me
12:22:46 <talismanick> wat: https://0x0.st/-kWt.txt
12:22:54 <geekosaur> which is a historical wart
12:23:05 <arahael> unit73e: I'm a somewhat novice haskeller, still, but I find the lens theory confusing - I find lens are useful, but best kept to a minimum; I like them for *simple* data structures.
12:23:05 <talismanick> You see the logfile from earlier - it says it halted at 10 compilations out of 24
12:23:14 <talismanick> Yet I repeated it now
12:23:17 <talismanick> and it finished
12:23:37 <maerwald> nice, just reboot
12:23:45 <talismanick> I didn't install any systemwide packages, set extra envvars or try with different compilation flags
12:23:51 × eggplantade quits (~Eggplanta@2600:1700:bef1:5e10:21fb:d4a:1e2:e3eb) (Ping timeout: 245 seconds)
12:23:55 <geekosaur> fake-package-0 sounds like something went wrong computing dependencies
12:24:02 <talismanick> maerwald: I did. Is that why it succeeded?
12:24:06 <merijn> geekosaur: No
12:24:07 <maerwald> geekosaur: no, that's what happens with `cabal repl`
12:24:15 <maerwald> talismanick: no idea
12:24:20 <merijn> geekosaur: That's what cabal uses to have a proper/sane temp environment
12:24:37 <merijn> geekosaur: It basically generates a valid "fake-package" with your constraints then does the normal package workflow
12:24:39 <geekosaur> weird. then again ghci is a bit of a wart itself
12:24:54 <maerwald> are we hating on everything now? :D
12:25:08 <talismanick> Doesn't it take expressions which ghc itself considers invalid?
12:25:10 <geekosaur> is there ever a time not to hate on everything?
12:25:13 <talismanick> Or is it the other way around?
12:25:15 <arahael> maerwald: Your fork() started it. :)
12:25:17 <merijn> maerwald: It's a matter or how much to hate something
12:25:48 <talismanick> It's a byte-compiling interpreter wholly separate from the AOT compiler everyone thinks of as GHC, right?
12:26:02 <arahael> talismanick: I thought ghci compiles it.
12:26:03 <merijn> Not wholly separate
12:26:14 Pickchea joins (~private@user/pickchea)
12:26:16 <geekosaur> it can be but usually isn't
12:26:23 <merijn> talismanick: Not the same way GHC does. ghci (by default) does bytecode interpretation
12:26:32 <geekosaur> sadly nobody kept ghci-ng up to date
12:27:06 <Hecate> last time I checked it was Intero right?
12:27:13 <talismanick> arahael: When I ran "cabal repl" and used that to install aeson, do you mean I installed a byte-compiled version instead of the "real thing" which GHC (rightly or wrongly) rejected earlier?
12:27:26 <maerwald> I doubt that
12:27:39 <geekosaur> what, -ng? no, that was where things like :doc and import syntax were tested before being broyught into ghci proper
12:27:54 <talismanick> That would explain why it succeeded with no extra changes, although I doubt a "correctness-first" language like Haskell would default to such rash behavior
12:27:55 <arahael> talismanick: I have no idea. :)
12:28:16 <maerwald> `ghc-pkg --package-db ~/.cabal/store/ghc-8.10.7/package.db list | grep aeson` should show something
12:28:27 × azeem quits (~azeem@emp-85-170.eduroam.uu.se) (Read error: Connection reset by peer)
12:28:45 <geekosaur> ghci itself is just a simple ghc-api client and can quite readily live outside of ghc; it'd just be a royal pain to keep up to date with ghc-api changes
12:29:37 <geekosaur> plus having it inside ghc means it can share code with TH
12:29:50 <talismanick> maerwald: Yes, it shows " aeson-1.5.6.0"
12:29:57 <maerwald> you're good to go tthen
12:30:28 jakalx joins (~jakalx@base.jakalx.net)
12:31:18 <geekosaur> >> "correctness-first"
12:31:33 <geekosaur> there are a lot of dark corners you don't want to peek into…
12:31:35 azeem joins (~azeem@emp-85-170.eduroam.uu.se)
12:32:16 machinedgod joins (~machinedg@135-23-192-217.cpe.pppoe.ca)
12:32:31 <maerwald> I've never viewed haskell as correctness-first
12:32:37 <maerwald> that wasn't the motivation of it
12:33:02 <maerwald> correctness first is usually very unpractical
12:37:08 gehmehgeh joins (~user@user/gehmehgeh)
12:37:49 lavaman joins (~lavaman@98.38.249.169)
12:39:53 <kuribas> correctness-first sounds like pdd (proof driven development).
12:40:05 <kuribas> where you first write the proof, then the code than fits the proof :)
12:40:47 × Pickchea quits (~private@user/pickchea) (Quit: Leaving)
12:41:22 <kuribas> I'd rather describe haskell as "abstraction first".
12:42:24 <kuribas> or better, "abstraction whenever desirable".
12:42:28 × lavaman quits (~lavaman@98.38.249.169) (Ping timeout: 252 seconds)
12:45:18 dsrt^ joins (~dsrt@70.166.66.234)
12:45:53 slowButPresent joins (~slowButPr@user/slowbutpresent)
12:46:57 o1lo01ol1o joins (~o1lo01ol1@bl13-86-242.dsl.telepac.pt)
12:48:09 × ubert quits (~Thunderbi@178.165.181.201.wireless.dyn.drei.com) (Remote host closed the connection)
12:48:58 jespada joins (~jespada@2803:9800:9842:7a62:c52b:2a1d:b7c2:2b5a)
12:50:52 <kuribas> The strong point in haskell is the ability to create abstractions, not to write correctness proofs.
12:51:12 <kuribas> But abstractions can help a lot in creating well-behaving programs.
12:51:26 <ManofLetters[m]> @arahael: could you kindly file a ticket about what's wrong with LambdaHack web display, ideally with a screenshot? does allureofthestars.com have he same problem? what browser (Firefox fares worst (IE not counted))
12:51:26 <lambdabot> Unknown command, try @list
12:52:03 <ski> kuribas : wouldn't you rather extract the code from the proof (hopefully with some irrelevancy erasure) ?
12:52:08 <ManofLetters[m]> arahael: and regarding fonts, the web version sticks with the square ones (until I code a Canvas frontend), but the binaries have proportional fonts for your reading pleasure
12:52:29 <ManofLetters[m]> s/@//
12:52:46 × o1lo01ol1o quits (~o1lo01ol1@bl13-86-242.dsl.telepac.pt) (Ping timeout: 265 seconds)
12:53:19 zebrag joins (~chris@user/zebrag)
12:54:32 <kuribas> ski: yeah, I'd be nice to write how you want the code to behave, and then have some AI generate the code that behaves like that.
12:54:54 ianon joins (~igloo@c-68-83-22-43.hsd1.nj.comcast.net)
12:55:19 <geekosaur> hope to God you're not writing it in English
12:56:29 <ski> reminds me of how someone (Cale ?) mentioned someone showed some Haskell solving a problem, and then the other person wanted to see the "real code" (figuring the Haskell was pseudo-code)
12:57:20 <ManofLetters[m]> s/@//, s/he/the/
12:57:27 jinsun__ is now known as jinsun
12:58:13 o1lo01ol1o joins (~o1lo01ol1@bl13-86-242.dsl.telepac.pt)
13:05:19 max22- joins (~maxime@2a01cb0883359800813c3288fb4e8a2c.ipv6.abo.wanadoo.fr)
13:05:31 × ianon quits (~igloo@c-68-83-22-43.hsd1.nj.comcast.net) (Ping timeout: 252 seconds)
13:06:45 <kuribas> ski: was that the department of defense project?
13:07:53 <ski> hm, i dunno ?
13:08:04 ski only has a vague recollection of the anecdote
13:08:09 <kuribas> ski: http://www.cs.yale.edu/publications/techreports/tr1049.pdf
13:08:37 <ski> (or perhaps there's been more than one incident like that)
13:10:38 <kuribas> ski: "It is significant that Mr. Domanski, Mr Banowetz and Dr. Brosgol were all surprised and syspicious when we told them that Haskell prototype P1 is a complete tested executable program."
13:11:24 <kuribas> "We provided them with a copy of P1 without explaining that it was a program, and based on preconceptions from their past experience, they had studied P1 under the assumption that it was a mixture of requirements specification and top level design. They were convinced it was incomplete because it did not address issues such as data structure design and execution order."
13:12:05 <LiaoTao> Sounds like a regular day at my current company
13:12:11 <kuribas> LiaoTao: lol
13:12:22 ski . o O ( SNAFU ? )
13:12:31 <LiaoTao> I provide a solution and people begin complaining that it can't possibly work
13:12:36 LiaoTao shrugs
13:13:07 <LiaoTao> TGIF and all that
13:13:13 <kuribas> LiaoTao: in haskell?
13:13:14 <ski> kuribas : page ?
13:13:17 dschrempf joins (~dominik@070-207.dynamic.dsl.fonira.net)
13:13:28 <kuribas> ski: 14
13:13:32 <ski> ty
13:13:33 × o1lo01ol1o quits (~o1lo01ol1@bl13-86-242.dsl.telepac.pt) (Ping timeout: 265 seconds)
13:13:39 <LiaoTao> kuribas, In any language with any libraries that's not exactly what people have been using for 20 years
13:14:04 × fendor quits (~fendor@178.165.162.11.wireless.dyn.drei.com) (Remote host closed the connection)
13:14:23 fendor joins (~fendor@178.165.162.11.wireless.dyn.drei.com)
13:14:24 <ski> ("TGIF" ?)
13:14:29 <kuribas> LiaoTao: does that include lisp?
13:14:53 <LiaoTao> ski, Thank God It's Friday so I can get away from this misery
13:15:04 <LiaoTao> kuribas, You name it and they'll shame it
13:15:44 <LiaoTao> Anyway I didn't mean for this to become a diatribe
13:16:02 <kuribas> LiaoTao: time to start looking for another company?
13:16:21 <LiaoTao> Just waiting out my yearly bonus
13:16:38 <ski> ah, ty
13:17:02 <talismanick> Is it possible to use Obelisk with just cabal-install instead of Nix?
13:17:06 lavaman joins (~lavaman@98.38.249.169)
13:17:06 <kuribas> LiaoTao: you don't need to change yet, just look :)
13:18:20 <kuribas> "it is safe to say that some observers have simply discounted the results because in their minds the use of higher-order functions to capture regions was just a trick that would probably not be useful in other contexts"
13:18:31 <kuribas> I've seen this prejudice.
13:18:42 <ski> "regions" in which sense ?
13:18:52 × fendor quits (~fendor@178.165.162.11.wireless.dyn.drei.com) (Ping timeout: 265 seconds)
13:19:07 <kuribas> ski: geometric regions
13:19:47 <kuribas> I've seen criticism for the lack of introspection of HOFs. However in my experience it is rarely a problem.
13:19:57 <kuribas> You write your program so that you don't need to inspect data.
13:20:38 alzgh joins (~alzgh@user/alzgh)
13:21:23 fendor joins (~fendor@178.165.162.11.wireless.dyn.drei.com)
13:23:59 <ski> kuribas : geometric regions, as in graphics, or perhaps spatial modelling ? or regions of programs ?
13:24:36 <kuribas> ski: page 4
13:24:41 acowley joins (~acowley@c-68-83-22-43.hsd1.nj.comcast.net)
13:26:51 o1lo01ol1o joins (~o1lo01ol1@2001:8a0:6d7a:df01:e9a1:1385:aea9:e3d1)
13:28:41 <ski> hm, p. 2 mentions "geometric region server"
13:29:02 <ski> (haven't seen any mention of HOFs yet, though)
13:30:09 × kuribas quits (~user@ptr-25vy0i8rjj87ltkm4em.18120a2.ip6.access.telenet.be) (Quit: ERC (IRC client for Emacs 26.3))
13:31:30 × o1lo01ol1o quits (~o1lo01ol1@2001:8a0:6d7a:df01:e9a1:1385:aea9:e3d1) (Ping timeout: 268 seconds)
13:31:36 <jacks2> is there a cross-platform haskell library for printing colored terminal characters?
13:31:52 <ph88> I have a bit of a problem following my own program, it doesn't go into `go` on line 60 and i'm not sure why. I put trace everywhere but even then .. https://bpa.st/47IA
13:32:14 <LiaoTao> "For those who object to this use of functional languages, we suggest reading the rest of this paper as if it were about a video game. We do not intend this as a joke; [...]"
13:32:57 × rond_ quits (~rond_@2a02:a31a:a23c:f480:2fd7:e087:5546:a438) (Quit: Client closed)
13:33:07 <LiaoTao> I'm sure video games radiated even more credibility back then.
13:34:03 <sm> jacks2: ansi-terminal
13:34:05 <ski> maybe `ansi-terminal' or `text-ansi' ?
13:34:43 × Xraell quits (~yourname@45.157.15.145) (Remote host closed the connection)
13:35:03 <jacks2> nice
13:35:43 <jacks2> I didn't know windows supports ANSI codes
13:38:51 <jacks2> s/codes/colors
13:39:06 Profpatsch joins (~Profpatsc@static.88-198-193-255.clients.your-server.de)
13:39:20 twitu joins (~twitu@223.236.227.132)
13:40:29 <Profpatsch> I have a foo :: Ctx Foo and a bar :: Ctx Bar and a do1 :: Ctx a -> IO () and a do2 :: Ctx a -> IO ()
13:40:44 jakalx parts (~jakalx@base.jakalx.net) (Error from remote client)
13:41:03 <Profpatsch> Is it possible to do { x <- if … then foo else bar; do1 x; do2 x } somehow?
13:41:52 <Profpatsch> Or I guess I can create a do3 = do1 >> do2 and use different branches
13:42:23 <ski> not without using existentials
13:43:35 <Profpatsch> It’s fun cause I said to myself “I don’t need no stinkin typeclass” and now my data Ctx err = Ctx { fn1 :: IO (Either err a); printErr :: err -> Text }
13:43:43 <Profpatsch> and
13:43:52 <Profpatsch> you suddenly run into problems like that
13:44:19 slack1256 joins (~slack1256@45.4.2.52)
13:44:36 <Profpatsch> but even better, if I make err existential (which it totally could be), I can’d do fn1 ctx anymore
13:44:38 <ski> do you rely on having `Cxt Foo' & `Cxt Bar', rather than just `SomeCxt' ?
13:44:50 <Profpatsch> cause of escaping skolems
13:45:19 <Profpatsch> Alternative I can see is a HasX typeclass and associated type
13:45:27 <Profpatsch> But I have a distaste for those
13:45:29 <ski> you could have `do1,do2 :: SomeCxt -> IO ()'. or `withCxt :: SomeCxt -> (forall a. Cxt a -> b) -> b' or somesuch
13:45:51 <Profpatsch> ski: I actually have two impls for Ctx yeah
13:46:01 <ski> (perhaps replacing `b' with `IO b' or `IO ()', if you prefer)
13:46:17 <Profpatsch> One for an in-memory database that has err~Void and one for the real db that has err~Error
13:46:31 jakalx joins (~jakalx@base.jakalx.net)
13:46:49 <ski> Profpatsch : yea, but that's not what i asked about
13:47:19 <Profpatsch> ski: SomeCxt similar to SomeException?
13:47:27 × stiell quits (~stiell@gateway/tor-sasl/stiell) (Ping timeout: 276 seconds)
13:47:36 <ski> do you actually need be transparent in which of those two you're using, somewhere ? or can you just inject the particular choice of implementation, once, at the start, and then not care/bother about which that is, henceforth ?
13:47:49 <ski> `SomeCxt' being `exists a. Cxt a'
13:48:06 <Profpatsch> ski: I have everything I need in my code in the Ctx yes
13:48:11 <Profpatsch> so I don’t need to be transparent about it
13:48:15 × endless quits (~endlessed@51.81.211.147) (Quit: The Lounge - https://thelounge.chat)
13:49:01 <ski> (e.g. `data SomeCxt = forall err. MkSomeCxt { fn1 :: IO (Error err a),printErr :: err -> Text}' (hm, i suppose `a' should be another param ?))
13:49:22 <Profpatsch> hm hm
13:49:29 <ski> Profpatsch : in that case, it seems to me you don't need `Cxt', you just need `SomeCxt' (which you can rename to `Cxt' then, if you like)
13:50:23 <Profpatsch> ski: But now if you have a Ctx in hand, and try to use the accessors, you get a problem
13:50:33 stiell joins (~stiell@gateway/tor-sasl/stiell)
13:50:34 <ski> yes
13:50:40 <ski> when do you need to do that ?
13:51:25 <Profpatsch> ski: Ah, I was using the record as a collection functions that contain the database implementation
13:51:49 <ski> `exists err. (IO (Either err a),err -> Text)' is of course equivalent to just `IO (Either Text a)' .. but perhaps you have more fields in there ?
13:52:12 <Profpatsch> So you want to call the functions in the code, and they would dispatch to the actual implementation that you pass in from the toplevle
13:52:40 <ski> and the type of that actual implementation mentions `err' ?
13:53:01 lis is now known as lisq
13:53:15 <ski> (`err' being either `Void' or `Error' there)
13:53:39 <Profpatsch> e.g. I’d do (ctx & db & readSomeValues :: IO (Either err Val)) and when I want to print the errors, I’d call (ctx & db & printError :: err -> IO ())
13:54:10 <Profpatsch> It’s a little dsl that you can give different implementations
13:54:32 <ski> what's the types of `ctx',`db',`readSomeValues',`printError' ?
13:55:54 <Profpatsch> I’m sorry, (ctx & db :: Ctx)
13:56:24 <Profpatsch> you can ignore the db, I should have just written (ctx & readSomeValues :: …) here
13:56:34 × dibblego quits (~dibblego@haskell/developer/dibblego) (Ping timeout: 265 seconds)
13:57:04 dibblego joins (~dibblego@122-199-1-30.ip4.superloop.com)
13:57:04 × dibblego quits (~dibblego@122-199-1-30.ip4.superloop.com) (Changing host)
13:57:04 dibblego joins (~dibblego@haskell/developer/dibblego)
13:57:23 <Profpatsch> ctx :: Ctx, readSomeValues and printError are accessors of Ctx
13:57:53 pbrisbin joins (~patrick@pool-173-49-152-45.phlapa.fios.verizon.net)
13:58:12 <ski> hm, so i guess you want to "coordinate" your implementation, whose type mentions `err', with contexts, whose type should mention the same `err'
13:58:13 wroathe joins (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net)
13:58:13 × wroathe quits (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Changing host)
13:58:13 wroathe joins (~wroathe@user/wroathe)
13:58:18 <Profpatsch> Which have :: Ctx err -> IO (Either err Val) and :: Ctx err -> err -> IO ()
13:58:38 <Profpatsch> But now I see how the variables are escaping if you use existentials
13:59:02 <Profpatsch> cause then it turns into Ctx -> IO (Either err Val) and how would the compiler know what `err` is from the signature of the accessor
13:59:18 <ski> (just to be clear, this `Ctx err' is not the implementation itself, that you want to select at the start, right ?)
14:00:00 <Profpatsch> I have two implementations, inMemoryDb :: Ctx Void and postgres :: Ctx Error
14:00:20 <Profpatsch> which I pass to the main function main :: Ctx err -> IO ()
14:00:30 <ski> hm, ok (so that *is* then the "implementation" you spoke of)
14:00:36 <Profpatsch> And they define all functions of these two implementations
14:00:46 <Profpatsch> I guess there was not enough X to the Y :)
14:00:50 <ManofLetters[m]> BTW, most of the time when you think you need an existential to worth with both A and B, what really worse best is `Either A B`
14:00:50 o1lo01ol1o joins (~o1lo01ol1@2001:8a0:6d7a:df01:e9a1:1385:aea9:e3d1)
14:00:51 <ManofLetters[m]> s/worse/works/
14:01:11 <ski> so, what *else* do you want to do with the `err' in `IO (Either err Val)', *apart* from passing it to your `err -> IO ()' ?
14:01:33 <Profpatsch> ski: Nothing, really
14:01:35 × dschrempf quits (~dominik@070-207.dynamic.dsl.fonira.net) (Ping timeout: 260 seconds)
14:01:44 <Profpatsch> Errors that happen should be printed at one point
14:02:08 <ManofLetters[m]> s/BTW, most of the time when you think you need an existential to worth with both A and B, what really worse best is `Either A B`/BTW, most of the time when you think you need an existential to worth with both A and B, what really works best is `Either A B` [edit: or an equivalent datatype with no implementation exposed, but only some functions]/
14:02:19 <ski> Profpatsch : ok, then instead of passing in `data Ctx err = Ctx { fn1 :: IO (Either err a),printErr :: err -> Text }', just pass in a `data Ctx = Ctx { fn1 :: IO (Either Text a) }', no ?
14:03:11 <ski> Profpatsch : or else, manually define your `Ctx err -> IO (Either Text a)', in terms of the former definition of `Ctx' (which you could then wrap into `SomeCtx', as aforementioned)
14:03:24 <Profpatsch> ski: The original idea was that all of the fn1 .. fn2 .. fnN functions return Error for one impl, but Void for the in-memory db
14:03:47 <Profpatsch> Cause there obviously can’t be any e.g. Connection errors when not haviang any database to talk to
14:04:00 <ski> Profpatsch : afaiui, you don't actually need to get `Error' vs. `Void', but only need to get `Text', no ?
14:05:22 <ski> or is there some reason you'd like to know that you'll get a `Void', in that case ?
14:05:45 <Profpatsch> If I get a Void, the implementation of printError is `absurd`
14:05:50 <Profpatsch> so it can’t ever be called
14:06:11 <ski> yes, but that doesn't change, if you do my suggestion
14:06:32 <ski> only difference is that you fuse/inline `printError' with `fn1'
14:07:06 <Profpatsch> Hm, not sure I understand
14:07:31 <ski> so, the question is if you ever would like to know, in case you know that you passed in the `Ctx Void' implementation, that in the `Void' case of the `Either', "this can't happen" .. apart from knowing `printErr' can't happen
14:07:40 × o1lo01ol1o quits (~o1lo01ol1@2001:8a0:6d7a:df01:e9a1:1385:aea9:e3d1) (Ping timeout: 268 seconds)
14:08:56 o1lo01ol1o joins (~o1lo01ol1@2001:8a0:6d7a:df01:e9a1:1385:aea9:e3d1)
14:09:07 attoboy joins (~attoboy@47.186.214.206)
14:09:11 <ski> new_fn1 = fmap (left printErr) old_fn1 -- how the new `fn1' is related to the old one
14:09:44 <Profpatsch> Ah but it’s not that simple
14:10:05 <ski> yes ?
14:10:14 <Profpatsch> Actually fn1 returns a (Either (Either err Error) Val)
14:10:22 <Profpatsch> Where the error can either be internal or a user error
14:10:38 <Profpatsch> I mean I guess it’s isomorphic still
14:10:38 <ski> new_fn1 = fmap ((left . left) printErr) old_fn1 -- how the new `fn1' is related to the old one
14:10:52 <Profpatsch> But the logic is still central to one place
14:10:54 <codygman[m]> Can anyone help me understand why `named` (i.e. `<<foo>>` ) isn't being consumed using attoparsec?... (full message at https://libera.ems.host/_matrix/media/r0/download/libera.chat/da86a98b126638c75e003c6332f280433a1987eb)
14:10:55 <ski> (assuming you still have `IO' wrapping that)
14:10:56 <Profpatsch> and shouldn’t be in fn1
14:11:00 <ManofLetters[m]> s/BTW, most of the time when you think you need an existential to worth with both A and B, what really worse best is `Either A B`/BTW, most of the time when you think you need an existential to work with both A and B, what really works best is `Either A B` [edit: or an equivalent datatype with no implementation exposed, but only some functions]/
14:11:18 <Profpatsch> ManofLetters[m]: not sure what you are trying to say?
14:11:53 <ski> Profpatsch : you could still do `SomeCtx -> IO (Either Text a)', even if you do `data SomeCtx = forall err. MkSomeCtx { fn1 :: IO (Either (Either err Error) a),printErr :: err -> Text}'
14:12:24 <ski> ManofLetters[m] : fwiw, i'm not convinced that's the case here
14:12:42 × jacks2 quits (~bc8165b6@199.204.85.195) (Quit: CGI:IRC (Ping timeout))
14:13:09 <Profpatsch> I’m not sure how all of this fits together
14:13:19 <ski> Profpatsch : that way, `printErr' is not inside `fn1', but your `SomeCtx -> IO (Either (Either Text Error) a)' mixes them together in the obvious way
14:13:26 <Profpatsch> ski: so you are saying what I really should be doing is change fn1 to return Text instead of err?
14:13:40 <ski> Profpatsch : or define a `SomeCtx -> IO (Either (Either Text Error) a)'
14:13:54 <Profpatsch> There’s like fn1 to fn10
14:14:08 <ph88> codygman[m], i also would like to know that
14:14:15 <ski> .. unless you actually depend somewhere on being able to "see" the `Void' vs. `Error' .. but i haven't seen you saying that, yet
14:14:16 <Profpatsch> And more fns are being added or removed all the time, most of them return err
14:14:37 <Profpatsch> So i’d need to implement a SomeCtx -> … for all of them separately?
14:14:48 <ph88> codygman[m], what if you write your code in do-notation and add a view Debug.Trace (traceShow) in there ?
14:15:54 <ski> Profpatsch : hm, maybe you could write `Cxt err -> Cxt Text' (which you'll have to extend, everytime you add a `fn')
14:15:58 × o1lo01ol1o quits (~o1lo01ol1@2001:8a0:6d7a:df01:e9a1:1385:aea9:e3d1) (Ping timeout: 252 seconds)
14:16:19 <ManofLetters[m]> I'm saying `do { x <- if … then Left <$> foo else Right <$> bar; do1 x; do2 x }`
14:16:38 <ski> then you could use the original `fn1',&c. accessors, after calling this `Cxt err -> Cxt Text'
14:17:09 <codygman[m]> ph88: Hmm, I'll try that. Good idea
14:17:21 × kawzeg quits (kawzeg@2a01:7e01::f03c:92ff:fee2:ec34) (Quit: WeeChat 3.1)
14:17:56 <ski> ManofLetters[m] : so far, it seems to me Profpatsch's code (apart from the "implementation" that is fed in at the start) is truly agnostic in whether it's `Void' or `Error' .. and so doing `Either Void Error' seems like a useless complication, both in terms of source, and operationally
14:19:07 <Profpatsch> ski: why is that, in one case internal errors can happen and in the other it can’t
14:19:11 sedeki joins (~textual@user/sedeki)
14:19:16 <ski> why is what ?
14:19:26 <Profpatsch> Or do you mean since it is always going to return a Right the Text on the left doesn’t matter?
14:19:36 <ski> yes
14:19:38 <Profpatsch> Hmmmm
14:19:46 × lavaman quits (~lavaman@98.38.249.169) (Ping timeout: 265 seconds)
14:20:01 <Profpatsch> I mean you get a few guarantees by looking at the code
14:20:23 <ski> unless you somewhere really want to exploit it being `Void' on the left, rather than any old `Text', which actually can't happen .. in that case, you'd not be transparent/agnostic in `err'
14:20:24 <Profpatsch> or can’t do a mistake when writing the handlers for memorydb and suddenly return a Left
14:21:06 kawzeg joins (kawzeg@2a01:7e01::f03c:92ff:fee2:ec34)
14:21:06 <Profpatsch> The only thing I’ve now added to the setup code is that it does two branches which have two different types
14:21:24 eggplantade joins (~Eggplanta@2600:1700:bef1:5e10:b4b8:992:53b6:115b)
14:21:48 Sgeo joins (~Sgeo@user/sgeo)
14:21:48 ski reponders "Is it possible to do { x <- if … then foo else bar; do1 x; do2 x } somehow?"
14:22:09 <Profpatsch> I mean apparently it’s not, but you can kinda work around it by having separate branches
14:22:16 <ManofLetters[m]> ski: I see what you mean, but in this case hide the Either type in newtype in a module and only expose enough to pack it at the start and use it somewhere at the end (don't import the module with the type in all the intervening code that only passes the errors along)
14:22:28 <ski> if you truly want that, you either need existentials, or `Either' (per ManofLetters[m]), afaics
14:22:44 <codygman[m]> ph88 it's because manyTill consumes named. Here is a simpler example:... (full message at https://libera.ems.host/_matrix/media/r0/download/libera.chat/0986f2910032d18911f03d2da64e4de88fb58433)
14:22:47 o1lo01ol1o joins (~o1lo01ol1@bl13-86-242.dsl.telepac.pt)
14:22:55 <Profpatsch> ManofLetters[m]: Usually I’m with you yes
14:23:03 <Profpatsch> otoh it’s Haskell not Ocaml
14:23:34 <Profpatsch> Both HasX typeclasses and this approach are solved by module functors in Ocaml
14:23:40 <ski> if `do do1 x; do2 x' is large, you could define that to be `doAll x', and go `if … then doAll foo else doAll bar' ..
14:23:55 <ManofLetters[m]> I'm writing OCaml in Haskell for a decade and I don't complain :)
14:23:57 <Profpatsch> yeah, that’s essentially what I have now
14:24:03 × sedeki quits (~textual@user/sedeki) (Quit: Textual IRC Client: www.textualapp.com)
14:24:13 <Profpatsch> I’m just super against abusing type classes as a module system
14:24:27 <Profpatsch> I’d rather abuse records as a module system :P
14:24:45 <ski> i haven't really heard anything suggesting to use type classes, yet
14:24:54 <ManofLetters[m]> Profpatsch: you can do that in Haskell, partially by convention (like, don't use FooInternal modules, etc.)
14:25:10 <Profpatsch> (or rather this was kind of an experiment on whether it’s feasible to use records for this use case, and currently it still looks like it’s superior to Has* typeclasses)
14:25:18 cads is now known as OxDEADBEEF
14:25:52 × eggplantade quits (~Eggplanta@2600:1700:bef1:5e10:b4b8:992:53b6:115b) (Ping timeout: 252 seconds)
14:26:52 <codygman[m]> > <@codygman:matrix.org> ph88 it's because manyTill consumes named. Here is a simpler example:... (full message at https://libera.ems.host/_matrix/media/r0/download/libera.chat/ecc2a960b618eb6d9f195daeca0e37719d6ffb6c)
14:26:53 <lambdabot> <hint>:1:1: error: parse error on input ‘<@’
14:26:57 <ski> (fun fact, using existential records, you can simulate an ML functor, generating a module/structure including an opaque type .. (in fact, it even corresponds to run-time module functor instantiation) -- i learned this from some posts by (i think) Joachim Durcholtz (sp?), on <news:comp.lang.functional>, many years ago)
14:28:00 <ski> (or maybe it was Adrian Hay ?)
14:29:26 segfaultfizzbuzz joins (~segfaultf@135-180-0-138.static.sonic.net)
14:30:07 <ski> Profpatsch : anyway, `do { x <- if … then WrapCtx foo else WrapCtx bar; withCtx doAll x }' ought to work, too
14:30:34 <ManofLetters[m]> of if it's truly the case that the code is "truly agnostic in whether it's `Void' or `Error'", then print the error to Text ASAP and store Text --- it's lazy anywa
14:30:35 shapr joins (~user@pool-100-36-247-68.washdc.fios.verizon.net)
14:30:36 <ManofLetters[m]> s/anywa/anyway/
14:30:49 <ManofLetters[m]> s/'/`/, s/anywa/anyway/
14:30:53 <ManofLetters[m]> s/'/`/, s/'/`/, s/anywa/anyway/
14:30:53 × merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 265 seconds)
14:31:16 <ph88> codygman[m], i am happy you figured out the problem ! did you found a workaround for it ?
14:31:18 <ski> ManofLetters[m] : yea, what i was suggesting :)
14:31:26 <ManofLetters[m]> oh :D
14:31:45 <ph88> codygman[m], on which matrix channel are you ?
14:32:40 <ski> (but apparently it is desired not to inline `printErr' .. which is ok, one can make a wrapper. possibly along the `Ctx err -> Ctx Text' line, if one wants to be able to use the original accessors. but then there's no existentials, mind)
14:32:43 <ph88> Could anyone take a look at my code ? ski maybe ? https://bpa.st/47IA i wonder why it doesn't go into `go` on line 60 when the debug trace is being print in the same location
14:35:03 shriekingnoise joins (~shrieking@186.137.144.80)
14:35:56 × acidjnk_new3 quits (~acidjnk@p200300d0c703cb999d5eb9ee05a422b5.dip0.t-ipconnect.de) (Ping timeout: 245 seconds)
14:39:23 <ski> ph88 : hm, seems to me it does go into it .. one time ?
14:40:20 ski idly realizes ManofLetters[m] is on Matrix[m]
14:41:28 × hendursa1 quits (~weechat@user/hendursaga) (Quit: hendursa1)
14:42:01 hendursaga joins (~weechat@user/hendursaga)
14:42:52 <ManofLetters[m]> oh, this is IRC? greetings from the future! ;D
14:43:11 <ManofLetters[m]> we will remember you fondly
14:43:23 <ski> i was wondering why you were sedding like crazy
14:44:30 ski . o O ( <https://xkcd.com/1782/> )
14:44:32 <codygman[m]> <ph88> "codygman, i am happy you figured..." <- Oh I didn't figure it out, only that I can't use `manyTill (manyTill ..)` and I'm not sure how to proceed 😅
14:44:32 <ph88> ski, ye but not the last time ?
14:45:21 <ph88> codygman[m], looking at the implementation of manyTill might give you ideas as well (i also don't know)
14:46:13 <ManofLetters[m]> oh, dear, so all my dozens of edits actually end up us separate posts?
14:46:18 <ManofLetters[m]> s/,//
14:46:22 × kawzeg quits (kawzeg@2a01:7e01::f03c:92ff:fee2:ec34) (Quit: WeeChat 3.2)
14:46:59 [itchyjunk] joins (~itchyjunk@user/itchyjunk/x-7353470)
14:47:05 pretty_dumm_guy joins (trottel@gateway/vpn/protonvpn/prettydummguy/x-88029655)
14:47:14 <ManofLetters[m]> you should have seen this coming when Matrix tricked you into letting them assimilate you
14:47:36 × funsafe quits (~funsafe@2601:1c1:4200:e53:2875:5507:42e4:4e14) (Ping timeout: 245 seconds)
14:47:48 × hyiltiz quits (~quassel@31.220.5.250) (Ping timeout: 265 seconds)
14:49:02 <ski> ph88 : not sure sure `z start' and `z 0' isn't output a second time .. oh, actually, i think i know that. the `traceShow' isn't attached to the parsing, but to evaluating the parser action
14:49:13 <geekosaur> someday someone will come up with an IRC client which interprets them
14:49:22 <geekosaur> it shouldn't even be all that difficult
14:49:27 waleee joins (~waleee@2001:9b0:216:8200:d457:9189:7843:1dbd)
14:50:00 <ski> ManofLetters[m] : yes. including "<ManofLetters[m]> s/BTW, most of the time when .. is `Either A B`/BTW, most of the time when .. is `Either A B` [edit: or an .. only some functions]/"
14:50:04 <geekosaur> I admit I'd been wondering if that needed to be traceIO or some variant thereof
14:50:33 ptrcmd_ is now known as ptrcmd
14:51:09 <ManofLetters[m]> 🤦
14:51:23 <ski> now and then, people in ##math have been saying something similar, about an IRC client interpreting TeX
14:52:06 <ski> (ManofLetters[m] : not repeating most of that message, to spare the guilty)
14:52:15 <geekosaur> probably do that with current clients if someone cares to write the plugin
14:52:30 hyiltiz joins (~quassel@31.220.5.250)
14:52:34 <geekosaur> I am for example almost certain hexchat could do it
14:52:52 <ski> the question is, would people actually want it, if they tried it, or do they only think they would ?
14:53:00 <geekosaur> right
14:53:19 <geekosaur> like browser TeX plugins, which IIRC was actually written but nobody used it
14:53:26 <ski> (leaky abstractions and all that)
14:53:26 yin is now known as zzz
14:55:31 × wroathe quits (~wroathe@user/wroathe) (Ping timeout: 252 seconds)
14:55:40 <ski> (ph88 : oh, also `f' and `P.Parser' are not type classes)
14:56:37 × vpan quits (~0@212.117.1.172) (Ping timeout: 252 seconds)
14:57:03 wroathe joins (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net)
14:57:03 × wroathe quits (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Changing host)
14:57:03 wroathe joins (~wroathe@user/wroathe)
14:58:27 <slack1256> Does a lsp-function exist such that it that searches for the call-tree of a function?
14:58:49 × dibblego quits (~dibblego@haskell/developer/dibblego) (Ping timeout: 252 seconds)
14:58:49 × xiongxin quits (~quassel@113.116.224.79) (Ping timeout: 252 seconds)
14:58:55 <slack1256> Mmm I guess the access to that functionality will be wrapped on a emacs function. If you know the name it would help me.
14:59:01 xiongxin joins (~quassel@113.116.224.79)
14:59:02 acidjnk_new3 joins (~acidjnk@p200300d0c703cb999d5eb9ee05a422b5.dip0.t-ipconnect.de)
15:00:12 merijn joins (~merijn@83-160-49-249.ip.xs4all.nl)
15:00:25 dibblego joins (~dibblego@122-199-1-30.ip4.superloop.com)
15:00:25 × dibblego quits (~dibblego@122-199-1-30.ip4.superloop.com) (Changing host)
15:00:25 dibblego joins (~dibblego@haskell/developer/dibblego)
15:03:05 × twitu quits (~twitu@223.236.227.132) (Ping timeout: 256 seconds)
15:04:19 <zzz> is there any reason, performance wise or otherwise, to keep functions inside of where/let bindings when we could just not, besides keeping the global space unpolluted or being able to benefit from scoped variables?
15:04:52 × merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 252 seconds)
15:05:40 <[exa]> zzz: monomorphism restriction and perhaps some specialization, other than that not much
15:06:13 <ski> more clearly grouping helper operations with their helpee ?
15:06:34 ski misses `local'-`in'-`end' in Haskell
15:06:46 <zzz> so it's mostly a matter of style for readability
15:07:17 <zzz> ski: what's local in end?
15:07:40 <slack1256> zzz: you can specify types on the where/let biding that are more restrictive versions of other functions. I use it all the time when I have access to a Rank2 function and I want to specify some types because I have ScopedTypeVariables specified.
15:07:46 <slack1256> But yeah, not much more than that.
15:08:05 <zzz> yes
15:08:06 × cfricke quits (~cfricke@user/cfricke) (Ping timeout: 268 seconds)
15:08:10 × dsrt^ quits (~dsrt@70.166.66.234) (Ping timeout: 252 seconds)
15:08:15 × waleee quits (~waleee@2001:9b0:216:8200:d457:9189:7843:1dbd) (Ping timeout: 265 seconds)
15:08:29 dsrt^ joins (~dsrt@70.166.66.234)
15:09:11 <ski> zzz : `let <decls> in <expr> end' vs. `local <decls> in <decls> end'. this is SML
15:09:26 <ski> the former is an expression, the latter is a declaration
15:09:39 waleee joins (~waleee@2001:9b0:216:8200:d457:9189:7843:1dbd)
15:09:54 <ski> so you can go
15:09:57 <ski> local
15:10:00 <geekosaur> yeh, I mostly use it for things that only make sense in the context of one particular function. but sometimes I end up floating them out because I turn out to need them elsewhere
15:10:11 <ski> ..private/helper definitions in here..
15:10:13 <ski> in
15:10:21 <ski> ..public definitions, using the private ones..
15:10:22 <ski> end
15:11:19 vpan joins (~0@212.117.1.172)
15:11:46 <ski> note "public definitions". plural, not singular. since doing `(foo,bar,baz) = (myFoo,myBar,myBaz) where myFoo = ...; myBar = ...; myBaz = ...; ..private definitions..' gets tired
15:14:22 hnOsmium0001 joins (uid453710@id-453710.hampstead.irccloud.com)
15:15:40 <ski> .. having `if' and `case' declarations could also occasionally be useful
15:16:26 lbseale joins (~lbseale@user/ep1ctetus)
15:21:16 × lortabac quits (~lortabac@2a01:e0a:541:b8f0:7767:27e:419a:f863) (Ping timeout: 268 seconds)
15:22:19 <codygman[m]> <dminuoso> "Aeson comes with TH helpers..." <- TH makes recompilation avoidance worse in my experience and can slow ghcid workflows on large codebases.
15:22:29 eggplantade joins (~Eggplanta@2600:1700:bef1:5e10:b4b8:992:53b6:115b)
15:25:59 <maerwald> and breaks cross compilation and haskell parsers and makes HLS crash, and...
15:27:27 × attoboy quits (~attoboy@47.186.214.206) (Ping timeout: 256 seconds)
15:27:31 × coot quits (~coot@37.30.48.91.nat.umts.dynamic.t-mobile.pl) (Quit: coot)
15:29:29 × wroathe quits (~wroathe@user/wroathe) (Ping timeout: 264 seconds)
15:31:52 × dibblego quits (~dibblego@haskell/developer/dibblego) (Ping timeout: 252 seconds)
15:32:59 dibblego joins (~dibblego@122-199-1-30.ip4.superloop.com)
15:32:59 × dibblego quits (~dibblego@122-199-1-30.ip4.superloop.com) (Changing host)
15:32:59 dibblego joins (~dibblego@haskell/developer/dibblego)
15:33:50 <Hecate> §2
15:34:07 <shapr> §3
15:34:07 twitu joins (~twitu@223.236.227.132)
15:34:26 <ski> §5
15:35:07 werneta joins (~werneta@70-142-214-115.lightspeed.irvnca.sbcglobal.net)
15:35:50 <Hecate> :O
15:36:19 <shapr> Hecate: I thought you were gonna do §8 !
15:37:14 <fryguybob> What am I doing wrong: data T a = T a a a deriving (Semigroup) via ((a,a,a)) ?
15:39:12 <Hecate> shapr: oh I'm still recovering from my lunch, don't ask too much of me ;_;_
15:39:16 × eggplantade quits (~Eggplanta@2600:1700:bef1:5e10:b4b8:992:53b6:115b) (Remote host closed the connection)
15:39:16 × xiongxin quits (~quassel@113.116.224.79) (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.)
15:39:22 <Hecate> erm, *;_;
15:39:28 eggplantade joins (~Eggplanta@2600:1700:bef1:5e10:b4b8:992:53b6:115b)
15:39:48 <Hecate> % data T a = T a a a deriving (Semigroup) via ((a,a,a))
15:39:48 <yahb> Hecate: ; <interactive>:74:30: error:; * Couldn't match representation of type: (a, a, a); with that of: T a; arising from the coercion of the method `<>' from type `(a, a, a) -> (a, a, a) -> (a, a, a)' to type `T a -> T a -> T a'; * When deriving the instance for (Semigroup (T a)); <interactive>:74:30: error:; * Couldn't match representation of type: (a, a, a)
15:41:03 wroathe joins (~wroathe@user/wroathe)
15:41:12 <Hecate> fryguybob: I'm curious, you are trying to piggy-back on the Semigroup instance for (a,a,a) right?
15:41:20 Null_A joins (~null_a@2601:645:8700:2290:3dbf:d4aa:b1ba:f84a)
15:41:21 <fryguybob> Right
15:41:43 <Hecate> fryguybob: where is this instance defined?
15:42:22 <fryguybob> instance (Monoid a, Monoid b, Monoid c) => Monoid (a, b, c) -- Defined in ‘GHC.Base’
15:42:53 <fryguybob> Oops, I meant Semigroup there.
15:43:01 <fryguybob> Same answer
15:45:34 × wroathe quits (~wroathe@user/wroathe) (Ping timeout: 252 seconds)
15:45:59 <Hecate> ah yes quite right
15:46:56 <fryguybob> % ("hello", "My") <> (" world", " friend")
15:46:56 <yahb> fryguybob: ("hello world","My friend")
15:47:37 <Hecate> maybe koz knows about this
15:47:45 × xff0x quits (~xff0x@2001:1a81:524d:6800:a178:5c71:40d3:e997) (Ping timeout: 260 seconds)
15:47:47 <Hecate> (koz knows many things)
15:47:58 wroathe joins (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net)
15:47:58 × wroathe quits (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Changing host)
15:47:58 wroathe joins (~wroathe@user/wroathe)
15:48:09 xff0x joins (~xff0x@2001:1a81:524d:6800:54c0:a41d:5321:6f97)
15:48:51 <monochrom> Is it just because T is not "newtype T a = MkT (a,a,a)"?
15:48:55 × dibblego quits (~dibblego@haskell/developer/dibblego) (Ping timeout: 252 seconds)
15:49:16 <fryguybob> That works fine without deriving via.
15:50:03 <fryguybob> "Couldn't match representation of type: (a, a, a)
15:50:04 × tromp quits (~textual@dhcp-077-249-230-040.chello.nl) (Quit: My iMac has gone to sleep. ZZZzzz…)
15:50:15 <fryguybob> Is there a ghci way to ask for the representation?
15:50:59 dibblego joins (~dibblego@122-199-1-30.ip4.superloop.com)
15:51:00 × dibblego quits (~dibblego@122-199-1-30.ip4.superloop.com) (Changing host)
15:51:00 dibblego joins (~dibblego@haskell/developer/dibblego)
15:51:05 × DNH quits (~DNH@2a02:8108:1100:16d8:31ac:ed04:1cbf:a354) (Quit: My MacBook has gone to sleep. ZZZzzz…)
15:51:51 <monochrom> See, that's my point, IIRC "same representation" just means "just a newtype away", not any real structural comparison.
15:53:06 <geekosaur> :seti -fprint-explicit-runtime-reps ?
15:54:00 × chele quits (~chele@user/chele) (Remote host closed the connection)
15:54:23 <geekosaur> hrm, actually I'd expect those to have the same runtimerep
15:54:36 <fryguybob> geekosaur: I think that's what I was thinking of.
15:55:07 Profpatsch parts (~Profpatsc@static.88-198-193-255.clients.your-server.de) (WeeChat 3.3)
15:55:23 <Hecate> monochrom: is this a case of DerivingVia bringing nothing more than what deriving newtype would?
15:55:54 <monochrom> Do you mean s/deriving newtype/GND/ ?
15:56:35 <monochrom> I think DerivingVia adds, for example: if Coercible s t, then Coercible (Maybe s) (Maybe t), etc.
15:56:36 <edwardk> nominal determinism at its best: https://twitter.com/i/events/1448993852904202244
15:57:07 <edwardk> oops
15:57:11 <edwardk> _wrong_ channel
15:57:27 edwardk waves hello.
15:57:38 <geekosaur> œ
15:58:07 <Hecate> monochrom: yeah
15:58:15 × wroathe quits (~wroathe@user/wroathe) (Ping timeout: 260 seconds)
15:58:20 <Hecate> % newtype T a = T (a, a, a) deriving (Semigroup) via (a,a,a)
15:58:20 <yahb> Hecate:
15:58:26 <Hecate> % newtype Y a = Y (a,a,a) deriving newtype Semigroup
15:58:27 <yahb> Hecate:
15:58:46 <edwardk> fryguybob: deriving via can work with newtypes, not isomorphic types
15:58:51 <monochrom> But I don't think it adds: "if "data S a = S Int a" and "data T a = T Int a" look obviously the same, then Coercible s t.
15:59:03 <Hecate> edwardk: aptly named fellow
15:59:06 <edwardk> you can use hecate's version, and then use a pattern synonym if the (,,)'s are ugly
15:59:35 _ht joins (~quassel@82-169-194-8.biz.kpn.net)
15:59:35 <fryguybob> edwardk: Huh, I thought the point was just having a matching runtime representation.
15:59:51 <edwardk> its not that clever, it just uses coercible instances
16:00:09 <fryguybob> I suppose I'm clever enough to write the instances :D
16:00:15 <edwardk> if you upgrade Coercible you can have it
16:00:26 <geekosaur> suppose that prevents you from violating a role?
16:00:49 <edwardk> or in that case i think the semigroups package even exports a template haskell splice thing for generating the instance
16:00:56 <edwardk> and a ghc.generics version
16:01:15 <edwardk> if i don't ryan has a version of it
16:01:18 wroathe joins (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net)
16:01:18 × wroathe quits (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Changing host)
16:01:18 wroathe joins (~wroathe@user/wroathe)
16:01:19 <edwardk> er other ryan
16:01:22 <fryguybob> :D
16:02:15 <monochrom> Wait, how do you upgrade Coercibe?
16:02:27 <edwardk> monochrom: ?
16:02:28 <geekosaur> presumably adding nbew rules/cases to it
16:02:38 <edwardk> none of those things change Coercible
16:02:53 <edwardk> the instance wasn't the Coercible one, it was the Semigroup he was generating
16:02:58 <edwardk> that was what i was referring to
16:05:32 <dsal> Argh, fighting lens hate when using it on something that lens is really good at and would be a huge pain to write without.
16:06:29 <monochrom> Or generally hate.
16:07:04 × acidjnk_new3 quits (~acidjnk@p200300d0c703cb999d5eb9ee05a422b5.dip0.t-ipconnect.de) (Ping timeout: 252 seconds)
16:08:54 acidjnk_new3 joins (~acidjnk@p200300d0c703cb999d5eb9ee05a422b5.dip0.t-ipconnect.de)
16:09:12 × vpan quits (~0@212.117.1.172) (Quit: Leaving.)
16:10:27 <fryguybob> The plate has been applied to the boiler.
16:12:52 × dibblego quits (~dibblego@haskell/developer/dibblego) (Ping timeout: 265 seconds)
16:14:00 mikoto-chan joins (~mikoto-ch@ip-83-134-2-136.dsl.scarlet.be)
16:14:01 dibblego joins (~dibblego@122-199-1-30.ip4.superloop.com)
16:14:01 × dibblego quits (~dibblego@122-199-1-30.ip4.superloop.com) (Changing host)
16:14:01 dibblego joins (~dibblego@haskell/developer/dibblego)
16:14:50 <dsal> Yeah, but I'm not talking plated. I've got a list of records that contain a Maybe JSON object that I want a list of the string values out of. I *can* write that without lenses, but apparently newbies can't run the lens stuff at a glance. Which I'm having trouble believing, honestly.
16:15:28 <dsal> `things ^.. folded . data . _Just . key "formatted" . _String` is not objectively hard to read.
16:16:20 <geekosaur> I, uh, wouldn't call it obvious
16:16:24 × max22- quits (~maxime@2a01cb0883359800813c3288fb4e8a2c.ipv6.abo.wanadoo.fr) (Quit: Leaving)
16:21:18 × eggplantade quits (~Eggplanta@2600:1700:bef1:5e10:b4b8:992:53b6:115b) (Remote host closed the connection)
16:21:41 <dsal> The alternative without lens looks like this: https://www.irccloud.com/pastebin/DBK968rO/lensless.hs
16:22:07 <dsal> (and, of course, breaks with an aeson upgrade for reasons nobody working on this piece of code cares about)
16:22:16 eggplantade joins (~Eggplanta@2600:1700:bef1:5e10:b4b8:992:53b6:115b)
16:24:32 wonko joins (~wjc@62.115.229.50)
16:24:57 × azeem quits (~azeem@emp-85-170.eduroam.uu.se) (Ping timeout: 265 seconds)
16:26:21 tzh joins (~tzh@c-24-21-73-154.hsd1.wa.comcast.net)
16:26:27 <ski> f lm = [s | Just (Object (HM.lookup "formatted" -> Just (String s))) <- [logData lm]]
16:26:35 <ski> or
16:26:55 <ski> f (logData -> Just (Object (HM.lookup "formatted" -> Just (String s)))) = [s]
16:27:18 <ski> f _ = [ ]
16:29:00 <ski> formatted = (`foldMap` things) \case (logData -> Just (Object (HM.lookup "formatted" -> Just (String s)))) -> [s]; _ -> [] -- i guess
16:29:36 <dsal> I don't think any of these are more obvious than simple lens things.
16:30:57 azeem joins (~azeem@2a00:801:238:7fcb:5228:4a72:5b90:f025)
16:31:16 <Rembane> I'm cool with reading the lens code, but I don't think I could write it, on a good day I could probably change it.
16:32:06 <dsal> A lot of the arguments are "newbies wouldn't understand this code." I don't want to get super weird with things, but I don't want to only write code for the least experienced person.
16:33:00 ski idly wonders whether the median, or average/expected, person would understand it
16:33:19 × dibblego quits (~dibblego@haskell/developer/dibblego) (Ping timeout: 265 seconds)
16:34:32 dibblego joins (~dibblego@122-199-1-30.ip4.superloop.com)
16:34:32 × dibblego quits (~dibblego@122-199-1-30.ip4.superloop.com) (Changing host)
16:34:32 dibblego joins (~dibblego@haskell/developer/dibblego)
16:34:53 × twitu quits (~twitu@223.236.227.132) (Ping timeout: 256 seconds)
16:37:17 <maerwald> the time to understand old lens code is rarely worth it for me
16:37:19 <dsal> There's a lot of conversations about where to draw the line as far as features and stuff. Apparently lenses are definitely a bad idea and they're never needed and nobody should ever use them for anything.
16:38:01 <dsal> I don't even know what the equivalent code looks like in the latest version of aeson. I don't expect the lens code to break there, though.
16:38:10 <maerwald> if you use them regularly, it probably makes sense... but if you use them occasinally, you forget things quickly, because none of it is really intuitive
16:38:54 MQ-17J joins (~MQ-17J@d192-24-122-179.try.wideopenwest.com)
16:43:47 × dibblego quits (~dibblego@haskell/developer/dibblego) (Ping timeout: 240 seconds)
16:44:50 <shapr> maerwald: I agree
16:46:49 fluffyballoon joins (~user@131.93.208.196)
16:48:54 tromp joins (~textual@dhcp-077-249-230-040.chello.nl)
16:50:29 × MQ-17J quits (~MQ-17J@d192-24-122-179.try.wideopenwest.com) (Ping timeout: 264 seconds)
16:50:46 MQ-17J joins (~MQ-17J@d192-24-122-179.try.wideopenwest.com)
16:50:55 emliunix joins (~emliunix@2a09:bac0:23::815:b6d)
16:51:26 emliunix parts (~emliunix@2a09:bac0:23::815:b6d) ()
16:53:26 × waleee quits (~waleee@2001:9b0:216:8200:d457:9189:7843:1dbd) (Ping timeout: 245 seconds)
16:55:23 <monochrom> There is "write to the level of the audience". But there is also "what about encouraging the audience to raise their level?".
16:56:31 <dsal> I don't really want to work with people who get confused when I use something like `*>` instead of a `do` block.
16:56:58 <monochrom> I think almost everyone writes in their CV "career goal: ... blah blah ... growth ... blah blah...". You can call it out on that whenever they resist progress.
16:57:29 <dsal> i.e., I don't mind people not knowing something right away, but we can learn better. I do think there's a line where something is just too fancy.
16:57:36 <monochrom> If I write only code that you perfectly understand, will you grow?
16:57:59 × MQ-17J quits (~MQ-17J@d192-24-122-179.try.wideopenwest.com) (Ping timeout: 264 seconds)
16:58:16 MQ-17J joins (~MQ-17J@8.6.144.117)
17:00:16 <maerwald> I don't think it's about progress. It's about the balance of learning/using something compared to the gain. When someone tells me to learn nix to build their project, I say "no".
17:00:31 vladomiro joins (~vladomiro@2806:106e:23:c05a:523e:aaff:feb9:bb5c)
17:01:00 ski . o O ( ‟Everyone knows that debugging is twice as hard as writing a program in the first place. So if you're as clever as you can be when you write it, how will you ever debug it?” -- "Kernighan's lever" by Linus Åkesson in 2012-12-11 at <https://www.linusakesson.net/programming/kernighans-lever/index.php> )
17:01:13 merijn joins (~merijn@83-160-49-249.ip.xs4all.nl)
17:01:32 <dsal> Heh. Sure, but you have an argument against nix that isn't just "I don't know what any of these functions do at first glance"
17:01:49 <maerwald> ski: except many Haskellers think they don't need to debug Haskell, because "types" :p
17:02:03 <Hecate> those people are blessed with ignorance
17:02:21 <monochrom> You know what, I challenge the premise that debugging is twice as hard as writing.
17:02:44 <maerwald> monochrom: oh really... wait until you get user bug reports from platforms you're not using :D
17:02:57 <monochrom> haha
17:03:30 <monochrom> But fixing that is writing not debugging.
17:03:44 <dsal> I have the "every few million times you do this, a thing hangs" kind of bugs sometimes.
17:04:18 <monochrom> Before fixing, the spec was merely "works on my platform". After fixing, the spec becomes "works on more platforms". This is not debugging, this is adding features. This is writing.
17:05:42 <monochrom> But my premise is that my "writing" already includes what other people consider "don't do it until debugging".
17:06:37 <monochrom> In some critical parts, my "writing" includes "proving", which is twice as hard as "debugging".
17:06:43 <koz> What do I supposedly know about?
17:07:06 <monochrom> So, my writing is 4 times as hard as debugging? Or did I accidentally make a strange loop there?
17:07:15 <maerwald> well, tbf... that statement is in he context of C programs I guess
17:07:35 <maerwald> 10 lines of C code usually lead to 2 hours of debugging
17:07:42 <monochrom> Oh heh koz, about why "data T a = T a a a deriving Semigroup via (a,a,a)" is rejected.
17:08:24 <koz> Because you can't via-derive if you're not coercible.
17:08:34 <geekosaur> yeh, we already got there
17:08:34 <monochrom> Yeah :)
17:08:52 <koz> maerwald: So much this.
17:08:54 <monochrom> We figured it out eventually.
17:09:14 <geekosaur> the error message could be clearer since it sounds like it's enough to have the same RuntimeRep
17:10:12 <monochrom> Yeah, it misleads one to "let me check GHC Execution Model again to prove that T a and (a,a,a) are the same at the machine level"
17:10:25 × tromp quits (~textual@dhcp-077-249-230-040.chello.nl) (Quit: My iMac has gone to sleep. ZZZzzz…)
17:10:34 <monochrom> which the compiler totally doesn't care
17:11:29 emf joins (~emf@2620:10d:c090:400::5:57e9)
17:11:32 klunk joins (~klunk@user/klunk)
17:11:50 coot joins (~coot@37.30.48.91.nat.umts.dynamic.t-mobile.pl)
17:12:28 × hyiltiz quits (~quassel@31.220.5.250) (Ping timeout: 265 seconds)
17:12:54 <geekosaur> don't even need the Execution Model, you can get ghc to dump the RuntimeRep of a type (set the flag I pointed to earlier and use :k, I think) and confirm they're the same
17:13:09 <monochrom> The error message says one thing right and one thing wrong.
17:13:15 hyiltiz joins (~quassel@31.220.5.250)
17:13:37 <monochrom> The wrong part is bringing up "representation" as though it meant what most humans mean by that.
17:14:39 <monochrom> The right part is "can't coerce from (a,a,a)->(a,a,a)->(a,a,a) to T a -> T a -> T a"
17:14:41 bitmapper joins (uid464869@id-464869.lymington.irccloud.com)
17:15:07 <monochrom> As usual, the human mind always fixates on the wrong part.
17:16:52 × klunk quits (~klunk@user/klunk) (Quit: Client closed)
17:17:52 econo joins (uid147250@user/econo)
17:18:45 × hyiltiz quits (~quassel@31.220.5.250) (Ping timeout: 260 seconds)
17:19:06 × coot quits (~coot@37.30.48.91.nat.umts.dynamic.t-mobile.pl) (Quit: coot)
17:21:29 conphiz[m] joins (~conphizma@2001:470:69fc:105::c052)
17:21:33 favonia joins (~favonia@user/favonia)
17:24:01 × wroathe quits (~wroathe@user/wroathe) (Ping timeout: 252 seconds)
17:26:07 waleee joins (~waleee@2001:9b0:216:8200:d457:9189:7843:1dbd)
17:29:29 hyiltiz joins (~quassel@31.220.5.250)
17:29:31 × favonia quits (~favonia@user/favonia) (Ping timeout: 252 seconds)
17:29:44 ec joins (~ec@gateway/tor-sasl/ec)
17:31:35 × MQ-17J quits (~MQ-17J@8.6.144.117) (Ping timeout: 264 seconds)
17:33:35 × benin quits (~benin@183.82.206.194) (Ping timeout: 265 seconds)
17:35:29 wroathe joins (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net)
17:35:30 × wroathe quits (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Changing host)
17:35:30 wroathe joins (~wroathe@user/wroathe)
17:35:47 × merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 264 seconds)
17:36:11 MQ-17J joins (~MQ-17J@d192-24-122-179.try.wideopenwest.com)
17:37:25 <zzz> > False && True
17:37:27 <lambdabot> False
17:37:30 <zzz> monochrom: ^
17:38:03 <monochrom> Yeah but why && rather than || ?
17:38:17 <monochrom> And why not == or /= ?
17:38:59 <zzz> because
17:39:07 <zzz> wait i've got a good response for that
17:39:41 <monochrom> And did you know that all four of them are monoid operators for Bool? :)
17:39:52 × wroathe quits (~wroathe@user/wroathe) (Ping timeout: 265 seconds)
17:41:08 neurocyte0132889 joins (~neurocyte@45.14.189.246)
17:41:08 × neurocyte0132889 quits (~neurocyte@45.14.189.246) (Changing host)
17:41:08 neurocyte0132889 joins (~neurocyte@user/neurocyte)
17:41:14 <monochrom> One of which gives a very slick, free-of-case-analysis, just-do-algebra solution to logic puzzles such as "there is a angle or demon (you don't know which) at the crossroad..."
17:41:57 DNH joins (~DNH@2a02:8108:1100:16d8:31ac:ed04:1cbf:a354)
17:42:03 <Rembane> All monoids lie and speak the truth at the same time?
17:42:20 <zzz> monochrom: because `Left l >>= _ = Left l`
17:42:59 <monochrom> Yeah but why >>= rather than mplus? :)
17:43:06 <monochrom> @quote monochrom crossroad
17:43:06 <lambdabot> monochrom says: at a crossroad you meet an angel (always tells the truth) or demon (always lies). the crossroad gives you two choices of roads, one to heaven, one to hell, and only the angel or
17:43:06 <lambdabot> demon knows which is which. if you ask "how would you answer if I asked 'what is a monad?'", what will happen?
17:43:22 <zzz> monochrom: "if i asked the other one.."
17:43:55 <zzz> wait what
17:44:07 <monochrom> hahaha
17:44:12 <monochrom> But here: http://www.cs.utoronto.ca/~trebla/eq-wiltink.pdf
17:45:11 × MQ-17J quits (~MQ-17J@d192-24-122-179.try.wideopenwest.com) (Ping timeout: 265 seconds)
17:45:24 OscarZ joins (~oscarz@95.175.104.139)
17:46:01 <monochrom> And yeah the logic puzzle is still solvable if you don't have two guards, only one guard.
17:46:30 <monochrom> You don't need your question to refer to "the other guard" or even a hypothetical other guard.
17:47:56 MQ-17J joins (~MQ-17J@d192-24-122-179.try.wideopenwest.com)
17:48:29 <monochrom> The gist of the solution (with or without another guard) is "what would ... if ..." indirection. That's all you need. "What would you do if you were..." already works.
17:48:49 <zzz> this reminds of https://html.scribdassets.com/4zoxm0xb5syrh9w/images/1-4e83966743.jpg
17:49:26 <monochrom> Yeah, Smullyan is great.
17:51:04 <Franciman> we will not let the dictator take us all in the cage. Fork till the end
17:51:20 <Franciman> ops wrong chat
17:52:42 <zzz> monochrom: i don't agree with the casket thing
17:53:02 <zzz> you have to assume the inscriptions are truthful
17:53:55 <zzz> if you don't, the portrait can be in either casket
17:54:41 <monochrom> Perhaps [1] contains the detailed assumptions.
17:56:11 zincy joins (~tom@2a00:23c8:970c:4801:f4b9:dbfb:6f14:3bca)
17:57:21 <zincy> If you have two lists how would you join them into a map where keys are elem of list A and members are elems of list B?
17:57:42 × ec quits (~ec@gateway/tor-sasl/ec) (Ping timeout: 276 seconds)
17:57:56 <monochrom> zip?
17:57:57 <ski> which key corresponds to which member ?
17:58:35 <zincy> So the map keys would be members of list A
17:58:49 <zincy> where values of the map are related members of list B
17:58:49 <zzz> monochrom: ah yes
17:58:49 <ski> you said that, yes
17:58:56 <ski> related, how ?
17:59:17 <zincy> one field in the product type == another field by another name in the other product type
17:59:34 <zincy> Both fields are Int
18:00:00 <ski> dunno how these fields and product types are related to your two lists
18:00:29 <zincy> Sorry I am being really unclear
18:00:48 <zincy> I'll have a play and come back here
18:01:18 <monochrom> zzz: OK, as with the angel-demon puzzle, the assumption is "a statement is either knowingly honest or knowingly lying".
18:02:12 ec joins (~ec@gateway/tor-sasl/ec)
18:03:16 <monochrom> Actually, it can be weakened to "either true or false".
18:04:19 <tomsmeding> are you now rejecting intuitionism right there?
18:04:27 <monochrom> heh
18:04:38 <Franciman> what wiki software does haskellwiki use?
18:05:11 × neurocyte0132889 quits (~neurocyte@user/neurocyte) (Ping timeout: 264 seconds)
18:05:16 emliunix joins (~user@101.88.126.148)
18:05:30 <Franciman> looks like mediawiki
18:05:41 <Franciman> but I am not able to find any pointer
18:05:53 ski . o O ( hawiki was MoinMoin )
18:06:23 <Franciman> oh indeed it is mediawiki
18:06:27 <Franciman> https://github.com/haskell/haskell-wiki-configuration found here
18:06:27 × MQ-17J quits (~MQ-17J@d192-24-122-179.try.wideopenwest.com) (Ping timeout: 265 seconds)
18:06:30 <Franciman> thanks ski!
18:06:32 <monochrom> Nah, it is a contrapositive way to say: if you don't assume classical logic, then yeah the statements don't let you draw conclusions.
18:07:23 <Franciman> moin moin looks nice for my language aiming to replace haskell
18:07:31 × waleee quits (~waleee@2001:9b0:216:8200:d457:9189:7843:1dbd) (Ping timeout: 252 seconds)
18:07:31 <Franciman> for my personal use
18:07:33 <Franciman> I mean
18:09:00 <zzz> monochrom: yes we are assuming the inscriptions are consistent
18:09:11 <ski> @quote replace
18:09:12 <lambdabot> yottis says: i thought there were like 10 haskell jobs in the world, all in the "let's replace excel sheets with something else" industry < kalven> there are at least 20
18:12:57 × gehmehgeh quits (~user@user/gehmehgeh) (Quit: Leaving)
18:13:19 rond_ joins (~rond_@2a02:a31a:a23c:f480:2fd7:e087:5546:a438)
18:13:32 tromp joins (~textual@dhcp-077-249-230-040.chello.nl)
18:20:31 <zwro[m]> if we have a logic that is sound and we establish that an argument is only valid if derivable, does it necessary follow that we can derive all truths?
18:20:38 markusde joins (~makrus@206.12.14.188)
18:20:42 favonia joins (~favonia@user/favonia)
18:21:43 <monochrom> Yes.
18:21:46 × o1lo01ol1o quits (~o1lo01ol1@bl13-86-242.dsl.telepac.pt) (Ping timeout: 252 seconds)
18:22:16 gehmehgeh joins (~user@user/gehmehgeh)
18:22:34 × emliunix quits (~user@101.88.126.148) (Quit: ERC (IRC client for Emacs 28.0.50))
18:23:23 <markusde> Conduit newbie here- docs say that it's "downstream driven", but one of the middle stages in my conduit is slow. Is there a way to make sure that the conduit won't close until all of my input data (finite, file) is processed?
18:23:55 <markusde> Or will a different library be better suited for this
18:24:10 × rond_ quits (~rond_@2a02:a31a:a23c:f480:2fd7:e087:5546:a438) (Quit: Client closed)
18:24:12 <c_wraith> "downstream driven" (or more usually, "pull-based") just means that things happen when they are requested by the last steps in the pipeline
18:24:31 <c_wraith> As opposed to happening when the first step in the pipeline generates data
18:25:12 <zwro[m]> that's what tickles me. i think there is a possible alternative interpretation to "arguments are only valid of derivable" but i can't quite explain it
18:25:41 <c_wraith> So... as long as your last step is to consume all the input, the upstream stuff will produce all the output to feed it.
18:25:45 <tomsmeding> zwro[m]: what do you mean with "argument"?
18:26:16 <markusde> c_wraith: I think I see. So I need to do something like generate Maybe data, and have my downstream continue asking for data when it's Just, or stop asking when there's Nothing?
18:26:33 <markusde> c_wraith: (ie. the downstream has to decide when the file is done being processed)
18:26:58 <c_wraith> markusde: well, the upstream can signal that it's out of data.
18:27:02 <zwro[m]> tomsmeding: as in formal deductible?
18:27:18 <tomsmeding> zwro[m]: isn't that the same as "derivable"?
18:27:22 MQ-17J joins (~MQ-17J@d192-24-122-179.try.wideopenwest.com)
18:27:35 <c_wraith> markusde: the important thing is that the pipeline operates when something is requested.
18:27:36 <monochrom> I suppose "argument" and "valid" can all be vague.
18:28:23 <markusde> c_wraith: Okay cool, I get it now. Last question- is there a cannoncial way to do this in the library anywhere?
18:28:44 <tomsmeding> zwro[m]: in my understanding (but I'm not a logician), a logic (also called a theory) gives a set of symbols etc and a set of assumptions and deduction rules. A theory has a set of statements that are provable.
18:29:15 <tomsmeding> Then you can have a _model_ of that theory, and a model has a set of statements that are _true_
18:29:28 <c_wraith> markusde: to do which? process the entirety of something? That should just be what happens by default unless you have a step that intentionally terminates early
18:29:36 <tomsmeding> and then you can prove that a theory is sound and/or complete or not for a model
18:29:53 <tomsmeding> but I may be conflating set theory and logic here :D
18:30:24 <tomsmeding> my point being: you can't answer your question without first pinning down exactly what the words in the question mean
18:31:00 <tomsmeding> actually I'm fairly sure I'm conflating set theory and logic, so take my model stuff with a large grain of sale
18:31:01 <tomsmeding> *salt
18:31:12 <zwro[m]> i never really studied logic
18:31:13 <zwro[m]> :(
18:31:29 o1lo01ol1o joins (~o1lo01ol1@2001:8a0:6d7a:df01:d886:e076:3ba:7fac)
18:31:30 <tomsmeding> I took a course like 4 years ago lol
18:31:35 <tomsmeding> and that was set theory actually
18:31:40 × MQ-17J quits (~MQ-17J@d192-24-122-179.try.wideopenwest.com) (Ping timeout: 252 seconds)
18:31:41 <zwro[m]> is classical logic both consistent and complete?
18:31:53 <monochrom> Yes.
18:32:19 <tomsmeding> Gödel's First Incompleteness Theorem: "Any consistent formal system F within which a certain amount of elementary arithmetic can be carried out is incomplete; i.e., there are statements of the language of F which can neither be proved nor disproved in F."
18:33:01 <c_wraith> classic propositional logic is consistent and complete. That word "propositional" is important.
18:33:04 MQ-17J joins (~MQ-17J@d192-24-122-179.try.wideopenwest.com)
18:33:11 <markusde> c_wraith: oh- right lol. Thanks for the help, I'm sure the rest will make sence when I have some actual code
18:33:13 <monochrom> No one mentions Gödel's first completeness theorem any more :( >:)
18:33:22 <c_wraith> I was about to!
18:33:22 <tomsmeding> c_wraith: right
18:33:42 <c_wraith> first-order logic is also complete and consistent. that was Goedel's completeness theorem.
18:33:46 <monochrom> It still works if you s/propositional/first-order/
18:33:54 <Franciman> is there a second completeness theorem too?
18:34:13 <monochrom> I don't know :)
18:34:21 <Franciman> sad
18:34:31 <zwro[m]> sometimes there's a zeroth
18:34:37 <zwro[m]> keep your hopes up
18:35:03 <Franciman> what do you think about this proposal? https://mail.haskell.org/pipermail/libraries/2021-October/031454.html ?
18:35:13 <Franciman> making read deprecated
18:35:30 <Franciman> oh wait, that's the answer to the proposal
18:35:37 <Inst> hi
18:35:39 <Franciman> not sure I understand that answer, tho
18:35:40 <Inst> if i want a haskell textbook
18:35:45 <Franciman> https://mail.haskell.org/pipermail/libraries/2021-October/031453.html
18:35:46 <Inst> for a non-programmer / fisrt language
18:35:51 <Inst> what would be the best textbook?
18:35:56 × o1lo01ol1o quits (~o1lo01ol1@2001:8a0:6d7a:df01:d886:e076:3ba:7fac) (Ping timeout: 245 seconds)
18:36:13 <monochrom> I understand "NOPE", especially given the all-caps.
18:36:29 <Franciman> heh
18:36:36 <Franciman> I also understand it as a bit of a rude
18:36:38 <Franciman> but I am not native
18:36:41 <Franciman> I may lose a lot of context
18:37:01 <monochrom> It may be rude but I support rudeness in this case, it is justified.
18:37:07 <Franciman> can I ask why?
18:37:19 <Franciman> it's becaus ethe proposal is not well argumented?
18:37:21 <zwro[m]> Inst: learn you a haskell for a great good is usually beginner friendly
18:37:39 <Inst> yeah, i'm already working on the web version of it
18:37:40 <geekosaur> I think some important distinctions were made a bit after the original proposal, such as marking it deprecated with readMaybe moved to Prelude and leaving it in that state for 10+ years instead of just removing it after 2 ghc releases or so as would normally be meant by "deprecation"
18:37:56 <monochrom> Political correctness do-gooders thinking that time is well spent on tiny little matters like "read is bad", "head is bad" deserve to be given a blunt and direct "NOPE".
18:38:19 <zwro[m]> Inst: https://www.haskellfromtheverybeginning.com/ this one also
18:38:33 <geekosaur> @where books
18:38:33 <lambdabot> https://www.extrema.is/articles/haskell-books, see also @where LYAH, RWH, YAHT, SOE, HR, PIH, TFwH, wikibook, PCPH, HPFFP, HTAC, TwT, FoP, PFAD, WYAH, non-haskell-books
18:38:38 <Inst> Any ratings of "Programming in Haskell"?
18:38:38 <geekosaur> take your pick
18:38:39 × ec quits (~ec@gateway/tor-sasl/ec) (Ping timeout: 276 seconds)
18:39:19 × markusde quits (~makrus@206.12.14.188) (Remote host closed the connection)
18:39:35 <Franciman> lol monochrom sure
18:39:36 <geekosaur> Hutton (PiH) is generally quite good
18:39:36 <Franciman> why not
18:40:16 <Franciman> thank you for letting us know what is important and what's not
18:40:19 <Franciman> :)
18:40:20 <geekosaur> even though we kinda hosed him by making a bunch of changes right after he'd released his second edition
18:40:47 <geekosaur> (I think AMP and FTP landed right after he released?)
18:41:02 <awpr> free excuse for a third edition to make even more money? sounds like a win to me
18:41:26 <unit73e> I feel like the basics are relatively easy
18:41:40 <geekosaur> if only it were that simple (or cheap)
18:41:51 <monochrom> I think PiH2 has got AMP. Let me check again.
18:42:00 <unit73e> to me it was harder to truly understand monads and all the friends
18:42:21 <Franciman> long live the haskell foundation
18:42:26 <awpr> hmm, hadn't considered publication costs
18:42:27 <unit73e> it's best just to use monads and later figure out why those work like that
18:42:31 <unit73e> at least that worked for me
18:42:40 × favonia quits (~favonia@user/favonia) (Ping timeout: 252 seconds)
18:42:42 <Franciman> fork and fork hard
18:42:52 <unit73e> otherwise it just doesn't work, specially with crappy metaphors
18:43:08 <monochrom> Yeah he has got AMP.
18:43:32 × vladomiro quits (~vladomiro@2806:106e:23:c05a:523e:aaff:feb9:bb5c) (Quit: Leaving)
18:43:34 <Inst> grrr, i wish i could go through all the textbooks
18:43:45 <unit73e> much better to get "NOPE" from the compiler and figure out why :P
18:44:12 <unit73e> shouldn't the wokes complain about GHC rudeness?
18:44:23 <monochrom> What is FTP again? Is it just having Foldable, Travserable, and for example foldl and foldr works for all Foldable? He has got those, too.
18:44:47 <geekosaur> yeh, essentially
18:45:07 ec joins (~ec@gateway/tor-sasl/ec)
18:45:14 <geekosaur> hm, maybe it was just before release and it was alll the last minute changes that hosed him
18:45:38 cfricke joins (~cfricke@user/cfricke)
18:46:18 <monochrom> Franciman: Yes, it is very important that I speak up and say, at least, what I think is unimportant and not even worth more time than a simple "NOPE".
18:46:46 <geekosaur> I do recall we got a very grumpy letter to -cafe about it
18:47:12 <monochrom> You see, the irony is that "no one should ever tell each other what's important" is not how we find out what's important.
18:47:22 o1lo01ol1o joins (~o1lo01ol1@bl13-86-242.dsl.telepac.pt)
18:47:50 × fluffyballoon quits (~user@131.93.208.196) (Ping timeout: 246 seconds)
18:47:52 <Franciman> I fail to see your point
18:48:03 <monochrom> Instead, we must all be brave to speak up "here is what I think is important" and only then can we collect statistics to find out what's the consensus.
18:48:20 <Franciman> I didn't say you should not say what's important
18:48:43 <monochrom> OK, so explain what you mean by <Franciman> thank you for letting us know what is important and what's not
18:48:54 <Franciman> I mean
18:48:54 × Null_A quits (~null_a@2601:645:8700:2290:3dbf:d4aa:b1ba:f84a) (Remote host closed the connection)
18:49:03 <Franciman> you said that saying read is bad is a tiny matter
18:49:15 <Franciman> I said thanks for clarifying that
18:49:38 <monochrom> Or you used sarcasm.
18:49:47 <Franciman> nope
18:49:55 <Franciman> I used sarcasm when I said I didn't understand that answer
18:50:01 <monochrom> See, if you s/us/me/ I would not take it as sarcasm.
18:50:41 <Franciman> I see
18:50:50 <Franciman> no I was not sarcastic
18:51:19 <monochrom> And your track record.
18:51:27 × o1lo01ol1o quits (~o1lo01ol1@bl13-86-242.dsl.telepac.pt) (Remote host closed the connection)
18:51:40 o1lo01ol1o joins (~o1lo01ol1@2001:8a0:6d7a:df01:78df:ce33:6c9c:5cc0)
18:51:45 <monochrom> Not too long ago you spent so much time asserting that a few people acted as dictators.
18:52:05 <Franciman> yes
18:52:07 <Franciman> I recall
18:52:15 <Franciman> and I also recall saying I was sorry
18:52:19 <Franciman> I overreacted
18:52:28 <Franciman> now if you believe I can't change
18:52:39 <Franciman> that's ok
18:52:59 <Franciman> in fact my initial question is what do you think about the proposal
18:53:03 <Franciman> not about the answer
18:53:37 <monochrom> OK I see now.
18:54:46 <monochrom> I use "read" in contexts of "x <- read <$> some digits" in parsers. I will need it.
18:55:15 <monochrom> I might not like even "deprecate after 10 years".
18:55:58 <monochrom> If it were really removed, I would just be "x <- fromJust . readMaybe <$> some digits".
18:56:11 <geekosaur> "leave around forever" was also posed as an option
18:56:31 <tomsmeding> then it's not deprecation, it's "advise not to use"
18:56:38 <Franciman> I like the idea of having readMaybe in the prelude, tbh
18:56:39 <monochrom> This is why I said "political correctness do-gooders".
18:56:44 <geekosaur> yes, but deprecation is the mechanism we have
18:56:45 <zzz> we should remove fromJust
18:56:48 <Franciman> indipendently of what read has
18:56:52 <Franciman> as its faith
18:56:54 <monochrom> Oh, readMaybe is a godsent, too.
18:57:40 <geekosaur> and I'm not sure an ADVISE pragma belongs in ghc
18:57:58 <Franciman> readEither seems strange, as pointed in the ML thread, because there would be no error message
18:58:03 <geekosaur> (as opposed to, say, hlint)
18:58:07 <monochrom> I painstakingly wrote http://www.vex.net/~trebla/haskell/reads.xhtml because readMaybe did not exist. Using reads is very annoying, even after my explanation. readMaybe is objectively simpler and more direct.
18:58:34 <monochrom> But if I have "some digits" then "read" is the correct solution.
18:59:03 <Franciman> would you like to have read redefined as `read = fromJust . readMaybe` ?
18:59:13 <Franciman> and readMaybe as the only element of Read typeclass
18:59:23 <monochrom> hlint is too dumb to discern good uses vs bad uses of read, or generally good code vs bad code.
18:59:49 <Franciman> also I like the idea of the documentation being consistent vs having to use an external tool to get these info
19:00:05 <monochrom> read is not an element of Read in the first place.
19:00:10 <monochrom> even reads is not.
19:00:14 <Franciman> oh is it not?
19:00:49 <tomsmeding> interesting, that's asymmetric with Show
19:01:10 <tomsmeding> (not sure that it matters really though)
19:01:52 <Franciman> interesting that we have readEither in the stdlib
19:02:00 <Franciman> and readMaybe too!
19:02:03 <Franciman> but not in prelude
19:04:21 alx741 joins (~alx741@181.196.68.37)
19:05:43 geekosaur agrees that readEither is a lie and should probably be removed
19:06:00 <Franciman> +1
19:06:32 <tomsmeding> there's only two possible errors?
19:06:50 <tomsmeding> should've made a datatype for that, data ReadError = NoParse | AmbiguousParse
19:06:53 <geekosaur> and readEither reports none of them
19:07:30 <tomsmeding> it does, right? in String form, which is not useful
19:07:33 <awpr> > readEither @Bool "NotTrue"
19:07:35 <lambdabot> error:
19:07:35 <lambdabot> Pattern syntax in expression context: readEither@Bool
19:07:35 <lambdabot> Did you mean to enable TypeApplications?
19:07:50 <tomsmeding> % readEither @Bool "NotTrue"
19:07:50 <yahb> tomsmeding: ; <interactive>:88:1: error:; * Variable not in scope: readEither :: String %t0 -> t; * Perhaps you meant one of these: `readLitChar' (imported from Data.Char), `M.mapEither' (imported from Data.Map), `IM.mapEither' (imported from Data.IntMap)
19:07:59 <tomsmeding> % import Text.Read
19:07:59 <yahb> tomsmeding:
19:08:01 <tomsmeding> % readEither @Bool "NotTrue"
19:08:01 <yahb> tomsmeding: Left "Prelude.read: no parse"
19:08:05 <monochrom> I don't think the ambiguity allowed by [(a,String)] has ever been actually used.
19:08:12 <geekosaur> hm, maybe it does
19:09:12 × ec quits (~ec@gateway/tor-sasl/ec) (Ping timeout: 276 seconds)
19:14:13 × o1lo01ol1o quits (~o1lo01ol1@2001:8a0:6d7a:df01:78df:ce33:6c9c:5cc0) (Remote host closed the connection)
19:16:29 ec joins (~ec@gateway/tor-sasl/ec)
19:20:05 Null_A joins (~null_a@2601:645:8700:2290:3dbf:d4aa:b1ba:f84a)
19:23:54 coot joins (~coot@37.30.48.91.nat.umts.dynamic.t-mobile.pl)
19:24:23 × emf quits (~emf@2620:10d:c090:400::5:57e9) (Quit: emf)
19:25:06 defanor_ is now known as defanor
19:27:23 zzz is now known as onion
19:30:44 × Null_A quits (~null_a@2601:645:8700:2290:3dbf:d4aa:b1ba:f84a) (Remote host closed the connection)
19:32:36 × MQ-17J quits (~MQ-17J@d192-24-122-179.try.wideopenwest.com) (Ping timeout: 245 seconds)
19:33:00 MQ-17J joins (~MQ-17J@d192-24-122-179.try.wideopenwest.com)
19:34:47 × DNH quits (~DNH@2a02:8108:1100:16d8:31ac:ed04:1cbf:a354) (Quit: My MacBook has gone to sleep. ZZZzzz…)
19:36:42 × mei6 quits (~mei@user/mei) (Quit: mei6)
19:37:35 × MQ-17J quits (~MQ-17J@d192-24-122-179.try.wideopenwest.com) (Ping timeout: 264 seconds)
19:38:47 × cfricke quits (~cfricke@user/cfricke) (Ping timeout: 264 seconds)
19:39:44 lavaman joins (~lavaman@98.38.249.169)
19:39:45 × ec quits (~ec@gateway/tor-sasl/ec) (Ping timeout: 276 seconds)
19:40:28 wroathe joins (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net)
19:40:28 × wroathe quits (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Changing host)
19:40:28 wroathe joins (~wroathe@user/wroathe)
19:42:11 MQ-17J joins (~MQ-17J@d192-24-122-179.try.wideopenwest.com)
19:44:11 × lavaman quits (~lavaman@98.38.249.169) (Ping timeout: 264 seconds)
19:46:17 <dolio> Right, the instances in base don't have ambiguous parses. That doesn't mean no type could possibly have an ambiguou parse.
19:46:52 <dolio> Also derived instances won't have ambiguous parses, I think.
19:47:22 ec joins (~ec@gateway/tor-sasl/ec)
19:51:12 cfricke joins (~cfricke@user/cfricke)
19:52:28 <dolio> Ambiguity in `ReadS` is probably necessary to properly handle intermediate states of the parse, rather than full parses. I.E. there might be multiple incomplete parses that are eventually resolved to a single full parse.
19:54:08 <dolio> But the first incomplete parse isn't necessarily the one that gets completed, so you can't use Maybe.
19:54:37 <tomsmeding> perhaps the intermediate state after parsing "(" when parsing a value of tuple type? Could be the tuple, could be a normal parenthesis
19:57:23 × hyiltiz quits (~quassel@31.220.5.250) (Ping timeout: 264 seconds)
19:58:12 <dolio> I don't have a specific example, but it's a common occurrence during parsing. It's what `try` is for in parsec.
19:59:48 hyiltiz joins (~quassel@31.220.5.250)
20:00:06 × wroathe quits (~wroathe@user/wroathe) (Ping timeout: 245 seconds)
20:00:19 <dolio> If you don't want to use it, you have to factor your grammar a lot.
20:01:03 <ski> monochrom : that doesn't mention `ReadS', nor use list comprehensions (nor `lex' to remove trailing whitespace) :/
20:01:53 <dolio> And I think you basically can't factor the grammar in `Read` by its very nature.
20:04:23 × hyiltiz quits (~quassel@31.220.5.250) (Ping timeout: 265 seconds)
20:05:08 waleee joins (~waleee@2001:9b0:216:8200:d457:9189:7843:1dbd)
20:05:21 × juhp quits (~juhp@128.106.188.220) (Ping timeout: 265 seconds)
20:06:44 wroathe joins (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net)
20:06:44 × wroathe quits (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Changing host)
20:06:44 wroathe joins (~wroathe@user/wroathe)
20:07:45 juhp joins (~juhp@128.106.188.220)
20:08:11 ubert joins (~Thunderbi@178.165.181.201.wireless.dyn.drei.com)
20:09:52 × OxDEADBEEF quits (~asdf@ip-64-72-99-234.lasvegas.net) (Quit: Leaving)
20:12:10 kjak joins (~kjak@pool-108-45-56-21.washdc.fios.verizon.net)
20:12:11 × waleee quits (~waleee@2001:9b0:216:8200:d457:9189:7843:1dbd) (Ping timeout: 245 seconds)
20:15:56 <dsal> I'm trying to use generic deriving for a monoid, but the compiler is warning that I forgot <> and stuff. Is there more to this than -XDeriveGeneric, derive (Generic), and `instance Semigroup X` ?
20:19:47 hyiltiz joins (~quassel@31.220.5.250)
20:27:02 kritzefitz[m] joins (~m-eem4n6@212.86.56.80)
20:27:47 merijn joins (~merijn@83-160-49-249.ip.xs4all.nl)
20:28:17 o1lo01ol1o joins (~o1lo01ol1@bl13-86-242.dsl.telepac.pt)
20:28:32 wootehfoot joins (~wootehfoo@user/wootehfoot)
20:28:32 × wootehfoot quits (~wootehfoo@user/wootehfoot) (Client Quit)
20:29:25 × wroathe quits (~wroathe@user/wroathe) (Ping timeout: 252 seconds)
20:30:53 wootehfoot joins (~wootehfoo@user/wootehfoot)
20:30:53 aegon joins (~mike@174.127.249.180)
20:31:03 DNH joins (~DNH@2a02:8108:1100:16d8:547f:5c76:6b1:9692)
20:31:09 jgeerds joins (~jgeerds@55d4da80.access.ecotel.net)
20:31:19 Null_A joins (~null_a@2601:645:8700:2290:3dbf:d4aa:b1ba:f84a)
20:31:30 wroathe joins (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net)
20:31:30 × wroathe quits (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Changing host)
20:31:30 wroathe joins (~wroathe@user/wroathe)
20:35:31 × Null_A quits (~null_a@2601:645:8700:2290:3dbf:d4aa:b1ba:f84a) (Ping timeout: 245 seconds)
20:36:59 × wroathe quits (~wroathe@user/wroathe) (Ping timeout: 264 seconds)
20:37:02 Null_A joins (~null_a@2601:645:8700:2290:3dbf:d4aa:b1ba:f84a)
20:38:09 × o1lo01ol1o quits (~o1lo01ol1@bl13-86-242.dsl.telepac.pt) (Remote host closed the connection)
20:40:22 × MQ-17J quits (~MQ-17J@d192-24-122-179.try.wideopenwest.com) (Ping timeout: 252 seconds)
20:40:33 <[exa]> dsal: wasn't DeriveAnyClass needed for this?
20:40:46 MQ-17J joins (~MQ-17J@d192-24-122-179.try.wideopenwest.com)
20:41:04 <[exa]> also check if you get all prerequisities for deriving, e.g. if type parameters need to be semigroups or so
20:41:06 Cajun joins (~Cajun@user/cajun)
20:41:08 <awpr> neither of those will do anything meaningful if Semigroup doesn't provide a default implementation based on Generic
20:41:23 <[exa]> it doesn't?
20:41:45 × mikoto-chan quits (~mikoto-ch@ip-83-134-2-136.dsl.scarlet.be) (Ping timeout: 265 seconds)
20:42:38 <[exa]> :<
20:42:49 <awpr> https://hackage.haskell.org/package/wrapped-0.1.0.1/docs/Data-Wrapped.html#t:Wrapped provides that kind of instance to be used with `DerivingVia` like `data X = ... deriving Semigroup via Wrapped Generic X`
20:42:52 <dolio> DeriveAnyClass just lets you add `C` to the deriving clause instead of writing `instance C T`.
20:43:05 <awpr> but there are surely other implementations somewhere on Hackage
20:43:06 <dsal> My members are all either `Set Text` or `[Text]`
20:43:09 × kritzefitz quits (~kritzefit@picard.host.weltraumschlangen.de) (Quit: ZNC 1.8.2+deb2+b1 - https://znc.in)
20:43:21 kritzefitz[m] is now known as kritzefitz
20:43:22 <dsal> deriving-generic claims to have support, but it just didn't go.
20:45:01 emf joins (~emf@2620:10d:c090:400::5:35f6)
20:45:09 <awpr> DeriveGeneric doesn't make other classes have default implementations, it just provides the Generic instance. it's still up to someone else to write the methods against the Generic form, and up to you to get them into the instance somehow
20:45:47 <awpr> can choose "someone" = `wrapped` and "somehow" = `DerivingVia`, for example
20:46:29 <dsal> I've not paid much attention, usually just using generic deriving with stuff like JSON and not having to do a via or anything.
20:46:53 <awpr> if an empty instance decl works, it's because the class intentionally provided a default implementation
20:47:02 <geekosaur> right, JSON has a default implementation usinbg Generics. Semigroup doesn't
20:47:39 <geekosaur> but someone needs to provide that default impl and it has to use Generics
20:47:53 × raehik quits (~raehik@cpc95906-rdng25-2-0-cust156.15-3.cable.virginm.net) (Ping timeout: 265 seconds)
20:47:54 <awpr> without a default implementation, it's down to either manually writing an instance with something like `(<>) = genericSAppend` or adopting an instance with DerivingVia
20:48:06 <geekosaur> otherwise deriving Generic does nothing but take time
20:48:25 <dsal> Ah. I just thought that was magic that generic-deriving would conjure up.
20:48:27 × unmanbearpig quits (~unmanbear@user/unmanbearpig) (Ping timeout: 250 seconds)
20:48:37 wroathe joins (~wroathe@50-205-197-50-static.hfc.comcastbusiness.net)
20:48:37 × wroathe quits (~wroathe@50-205-197-50-static.hfc.comcastbusiness.net) (Changing host)
20:48:37 wroathe joins (~wroathe@user/wroathe)
20:48:44 raehik joins (~raehik@cpc95906-rdng25-2-0-cust156.15-3.cable.virginm.net)
20:51:54 <dsal> Hopefully I can delete this manual instance because it's kind of gross.
20:52:27 <geekosaur> wait until you see the code Generics comes up with >:)
20:52:42 × Null_A quits (~null_a@2601:645:8700:2290:3dbf:d4aa:b1ba:f84a) (Remote host closed the connection)
20:52:46 <dsal> Oh, I'm sure that's bad. I just don't want all this junk in a stupid test thing where I'm just trying to flatten and collect some fields.
20:52:52 <awpr> the most convenient thing I'm aware of is `deriving Semigroup via Wrapped Generic X` from `wrapped`
20:52:55 <monochrom> ski: ReadS is a type alias, so, not mandatory :)
20:52:57 <Franciman> Generics :')
20:54:02 <awpr> it should be able to generate perfectly fine code for Semigroup of moderate-sized records. it's only when things get too big for the inliner that it summons cthulhu
20:59:29 × machinedgod quits (~machinedg@135-23-192-217.cpe.pppoe.ca) (Ping timeout: 265 seconds)
21:02:23 × merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 265 seconds)
21:02:24 kritzefitz_ joins (~kritzefit@picard.host.weltraumschlangen.de)
21:04:38 × kritzefitz quits (~m-eem4n6@212.86.56.80) (Remote host closed the connection)
21:04:38 kritzefitz_ is now known as kritzefitz
21:04:46 kritzefitz_ joins (~kritzefit@212.86.56.80)
21:04:55 kritzefitz is now known as kritzefitz__
21:04:58 kritzefitz_ is now known as kritzefitz
21:06:32 <dsal> Ick, I can't figure out how to use the generics here. I don't have `wrapped` and trying to hack these instances into place with the supplied defaults is a recursive nightmare.
21:07:28 × kritzefitz__ quits (~kritzefit@picard.host.weltraumschlangen.de) (Quit: ZNC 1.8.2+deb2+b1 - https://znc.in)
21:07:46 <dsal> Pages of code because someone decided nobody will ever be able to read `logs ^.. folded . logData . _Just . key "formatted" . _String`
21:08:11 × emf quits (~emf@2620:10d:c090:400::5:35f6) (Quit: emf)
21:08:27 <awpr> I don't understand. what supplied defaults? are you trying to write your own implementation of Generics-based Semigroup instances?
21:09:04 <dsal> Yeah, the generic-deriving stuff just has `class GSemigroup a => GMonoid a where` and a default implementation of that.
21:09:27 <dsal> I don't have `wrapped` so I can't use that directly for the deriving via, so I'd have to reinvent it or something.
21:09:54 <dsal> There's no yak to be found here. None of this related to what I set out to do.
21:10:02 <awpr> sounds like `instance Semigroup X where (<>) = gsappend` should do it?
21:10:37 <monochrom> Today is automatic instance derivation day :(
21:10:42 <awpr> oh, that wants GSemigroup instances for the whole transitive closure of everything :(
21:11:33 <dsal> Yeah, that's about as far as I got.
21:11:33 <awpr> "It is worth emphasizing that these modules are primarly intended for educational purposes"
21:11:34 × MQ-17J quits (~MQ-17J@d192-24-122-179.try.wideopenwest.com) (Ping timeout: 265 seconds)
21:11:37 <dsal> haha
21:11:42 <dsal> I guess I learned something today,.
21:12:09 × shailangsa quits (~shailangs@host217-39-45-200.range217-39.btcentralplus.com) ()
21:12:41 <dsal> This seemed like the dumbest easiest thing. I've got a record full of monoids. Monoid me.
21:12:42 <awpr> if you can't depend on `wrapped` for whatever reason, it sounds like the easiest way is just to write the instance. unless you're lucky with all the fields already having `GSemigroup`
21:13:29 <dsal> I'd already written the instances just to see if the idea would even work. They just seem very mechanical.
21:13:50 <awpr> yeah, it is pretty easy. check out the implementation in `wrapped`, it's like 10 lines
21:14:16 <dsal> It's just `a <> b = foreachfield $\f -> on (<>) f a b` ish
21:14:41 <awpr> yeah, it's just that spelled out in the language of GHC.Generics
21:15:25 <awpr> only reason it's turning out to be hard is the inability to depend on the implementation that makes it easy :)
21:15:50 MQ-17J joins (~MQ-17J@d192-24-122-179.try.wideopenwest.com)
21:15:51 × _ht quits (~quassel@82-169-194-8.biz.kpn.net) (Remote host closed the connection)
21:16:36 <awpr> which I still don't actually understand, are there some strict rules about dependencies you have to follow? even in the test suite?
21:16:38 <dsal> I'll just complain about that in my implementation. Actually, I should verify I understand the mechanism first.
21:16:50 <dsal> Well, apparently nothing related to lens is a new strict rule today.
21:17:02 <dsal> But `wrapped` isn't available because of how packages come in.
21:17:22 <dsal> It's an older nix snapshot or something and not worth updating for just this test.
21:17:28 <dsal> Which was fine with microlens.
21:19:58 <sshine> first hacktoberfest PR, and I'm running into some obscure code that fails because of aeson's KeyMap.
21:20:18 <geekosaur> aeson 2 by any chance?
21:20:28 <sshine> yup :P
21:20:39 <geekosaur> can you just tell it to use an older version?
21:20:45 <sshine> yeah.
21:21:04 <dsal> Yeah, this is also super annoying. I'm going to have to change this code upon aeson upgrade because it's specific to hashmap instead of just like, ix.
21:21:05 × zebrag quits (~chris@user/zebrag) (Ping timeout: 264 seconds)
21:21:14 <geekosaur> otherwise, I understand the changes are supposed to be fairly simple
21:21:34 <geekosaur> justr annoying
21:21:48 <sshine> yup. this person just decided to make their own Value-traversing functions.
21:22:50 × unit73e quits (~emanuel@2001:818:e8dd:7c00:32b5:c2ff:fe6b:5291) (Ping timeout: 265 seconds)
21:24:21 × kritzefitz quits (~kritzefit@212.86.56.80) (Remote host closed the connection)
21:24:22 × coot quits (~coot@37.30.48.91.nat.umts.dynamic.t-mobile.pl) (Quit: coot)
21:24:57 kritzefitz joins (~kritzefit@212.86.56.80)
21:25:51 Lord_of_Life_ joins (~Lord@user/lord-of-life/x-2819915)
21:25:57 × Player001 quits (~Player001@user/player001) (Quit: Quitting)
21:26:20 Player001 joins (~Player001@user/player001)
21:26:26 × kritzefitz quits (~kritzefit@212.86.56.80) (Remote host closed the connection)
21:27:03 × Lord_of_Life quits (~Lord@user/lord-of-life/x-2819915) (Ping timeout: 265 seconds)
21:27:11 Lord_of_Life_ is now known as Lord_of_Life
21:27:18 emf joins (~emf@2620:10d:c090:400::5:35f6)
21:27:31 × MQ-17J quits (~MQ-17J@d192-24-122-179.try.wideopenwest.com) (Ping timeout: 265 seconds)
21:28:40 kritzefitz joins (~kritzefit@212.86.56.80)
21:29:06 × takuan quits (~takuan@178-116-218-225.access.telenet.be) (Remote host closed the connection)
21:29:19 MQ-17J joins (~MQ-17J@d192-24-122-179.try.wideopenwest.com)
21:30:33 × kritzefitz quits (~kritzefit@212.86.56.80) (Remote host closed the connection)
21:30:55 kritzefitz joins (~kritzefit@212.86.56.80)
21:30:59 × kritzefitz quits (~kritzefit@212.86.56.80) (Remote host closed the connection)
21:31:17 kritzefitz joins (~kritzefit@212.86.56.80)
21:33:35 waleee joins (~waleee@2001:9b0:216:8200:d457:9189:7843:1dbd)
21:33:48 × Gurkenglas quits (~Gurkengla@dslb-002-203-144-204.002.203.pools.vodafone-ip.de) (Ping timeout: 265 seconds)
21:35:02 <monochrom> Ugh cabal-install-parsers pulls in a ton of dependencies.
21:40:19 × MQ-17J quits (~MQ-17J@d192-24-122-179.try.wideopenwest.com) (Ping timeout: 252 seconds)
21:40:19 × cfricke quits (~cfricke@user/cfricke) (Ping timeout: 252 seconds)
21:40:24 <monochrom> No matter! I now have a good program that prunes my cabal store after I'm done :)
21:40:36 MQ-17J joins (~MQ-17J@8.6.144.117)
21:44:52 douglascorrea_io joins (~douglasco@200.146.85.128.static.gvt.net.br)
21:48:39 × ubert quits (~Thunderbi@178.165.181.201.wireless.dyn.drei.com) (Remote host closed the connection)
21:49:19 × wootehfoot quits (~wootehfoo@user/wootehfoot) (Quit: Leaving)
21:50:11 × MQ-17J quits (~MQ-17J@8.6.144.117) (Ping timeout: 264 seconds)
21:50:27 <monochrom> Then again, it includes aeson-2.0.1.0. That's a keeper for my next project :)
21:52:02 × __monty__ quits (~toonn@user/toonn) (Quit: leaving)
21:53:01 × wroathe quits (~wroathe@user/wroathe) (Ping timeout: 245 seconds)
21:53:33 MQ-17J joins (~MQ-17J@d192-24-122-179.try.wideopenwest.com)
21:54:03 shailangsa joins (~shailangs@host217-39-45-200.range217-39.btcentralplus.com)
21:55:45 × gehmehgeh quits (~user@user/gehmehgeh) (Quit: Leaving)
21:56:11 Null_A joins (~null_a@2601:645:8700:2290:3dbf:d4aa:b1ba:f84a)
21:57:01 × fendor quits (~fendor@178.165.162.11.wireless.dyn.drei.com) (Remote host closed the connection)
22:02:36 × ec quits (~ec@gateway/tor-sasl/ec) (Quit: ec)
22:02:44 × hippoid quits (~idris@184.105.6.88) (Quit: Lost terminal)
22:08:40 mestre joins (~mestre@191.177.175.57)
22:09:23 × wonko quits (~wjc@62.115.229.50) (Ping timeout: 264 seconds)
22:09:28 × doyougnu quits (~user@c-73-25-202-122.hsd1.or.comcast.net) (Ping timeout: 252 seconds)
22:10:03 wroathe joins (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net)
22:10:03 × wroathe quits (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Changing host)
22:10:03 wroathe joins (~wroathe@user/wroathe)
22:10:57 × Player001 quits (~Player001@user/player001) (Quit: Quitting)
22:11:30 × slack1256 quits (~slack1256@45.4.2.52) (Ping timeout: 265 seconds)
22:14:58 × wroathe quits (~wroathe@user/wroathe) (Ping timeout: 252 seconds)
22:16:34 × waleee quits (~waleee@2001:9b0:216:8200:d457:9189:7843:1dbd) (Quit: WeeChat 3.3)
22:17:04 waleee joins (~waleee@2001:9b0:216:8200:d457:9189:7843:1dbd)
22:18:54 bitdex joins (~bitdex@gateway/tor-sasl/bitdex)
22:25:13 wroathe joins (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net)
22:25:14 × wroathe quits (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Changing host)
22:25:14 wroathe joins (~wroathe@user/wroathe)
22:26:23 × Null_A quits (~null_a@2601:645:8700:2290:3dbf:d4aa:b1ba:f84a) (Remote host closed the connection)
22:28:26 hexfive joins (~eric@50.35.83.177)
22:28:29 × hexfive quits (~eric@50.35.83.177) (Client Quit)
22:33:59 × MQ-17J quits (~MQ-17J@d192-24-122-179.try.wideopenwest.com) (Ping timeout: 264 seconds)
22:37:05 MQ-17J joins (~MQ-17J@d192-24-122-179.try.wideopenwest.com)
22:41:03 zebrag joins (~chris@user/zebrag)
22:41:06 × Skyfire quits (~pyon@user/pyon) (Quit: WeeChat 3.3)
22:42:53 × mestre quits (~mestre@191.177.175.57) (Quit: Lost terminal)
22:43:45 × michalz quits (~michalz@185.246.204.93) (Remote host closed the connection)
22:46:08 × douglascorrea_io quits (~douglasco@200.146.85.128.static.gvt.net.br) (Quit: Leaving)
22:46:29 douglascorrea joins (~douglasco@200.146.85.128.static.gvt.net.br)
22:47:23 × douglascorrea quits (~douglasco@200.146.85.128.static.gvt.net.br) (Remote host closed the connection)
22:47:34 Player001 joins (~Player001@user/player001)
22:48:01 douglascorrea_io joins (~douglasco@200.146.85.128.static.gvt.net.br)
22:50:13 × ubert1 quits (~Thunderbi@178.165.181.201.wireless.dyn.drei.com) (Ping timeout: 252 seconds)
22:52:51 × douglascorrea_io quits (~douglasco@200.146.85.128.static.gvt.net.br) (Client Quit)
22:53:22 <phaazon> is there anyone know who knows how to implement a rank-2 type that introduces constraints on the records, not on the type itself? I basically need to create a data type for which fields are associated types in a typeclass, but I don’t want to constrain the whole type; instead, I would prefer constraining the type with a « universal typeclass » that can introduce the constraint on each
22:53:24 <phaazon> field; any idea?
22:53:36 douglascorrea_io joins (~douglasco@200.146.85.128.static.gvt.net.br)
22:54:06 × douglascorrea_io quits (~douglasco@200.146.85.128.static.gvt.net.br) (Client Quit)
22:54:37 × MQ-17J quits (~MQ-17J@d192-24-122-179.try.wideopenwest.com) (Ping timeout: 252 seconds)
22:54:50 gzj joins (~GZJ0X@199.193.127.89.16clouds.com)
22:54:51 <phaazon> the idea is that the class Backend b t has an associated data BackendRepr b t, and that thing needs to be used inside another data type, so I basically want something like data Collection b = forall t. Backend b t => Collection { … }
22:54:59 <phaazon> actually, maybe that works
22:55:07 douglascorrea_io joins (~douglasco@200.146.85.128.static.gvt.net.br)
22:57:40 MQ-17J joins (~MQ-17J@d192-24-122-179.try.wideopenwest.com)
22:58:42 merijn joins (~merijn@83-160-49-249.ip.xs4all.nl)
22:59:36 <phaazon> I will draft a gist to explain a bit more the problem
23:01:31 <phaazon> https://gist.github.com/phaazon/0c7489d231a9472b4012a05e2c8dcba6
23:01:59 <phaazon> I want to be able to change the newCollection value so that I can remove the list of Backend b _, and replace with a rank-2 constraint
23:02:05 <phaazon> I’m not even sure whether this is possible
23:04:14 <phaazon> maybe a GADT
23:10:55 × mc47 quits (~mc47@xmonad/TheMC47) (Remote host closed the connection)
23:14:20 × wroathe quits (~wroathe@user/wroathe) (Ping timeout: 265 seconds)
23:15:01 <phaazon> ooooh, maybe QuantifiedConstraints
23:15:31 <phaazon> oh yes it works with that
23:16:18 <phaazon> yeah, it was that…
23:16:43 × pretty_dumm_guy quits (trottel@gateway/vpn/protonvpn/prettydummguy/x-88029655) (Quit: WeeChat 3.3)
23:16:57 <awpr> assuming you wrote `(forall x. Backend b x) => Collection b`, you might not be able to call it, depending on how the instances are written
23:17:00 Skyfire joins (~pyon@user/pyon)
23:17:51 <phaazon> awpr: how so?
23:18:12 <awpr> it'd only work with instances like `instance ... => Backend MyType a` where `a` is just a type variable
23:18:32 <phaazon> so it’s not really rank-2?
23:19:40 × fvr quits (uid503686@id-503686.uxbridge.irccloud.com) (Quit: Connection closed for inactivity)
23:19:43 wroathe joins (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net)
23:19:43 × wroathe quits (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Changing host)
23:19:43 wroathe joins (~wroathe@user/wroathe)
23:20:01 <awpr> not quite sure what you mean, but the constraint `forall x. Backend b x` means "there is a single instance head that satisfies `Backend b x` for any `x`"
23:20:44 Tuplanolla joins (~Tuplanoll@91-159-69-50.elisa-laajakaista.fi)
23:21:01 × DNH quits (~DNH@2a02:8108:1100:16d8:547f:5c76:6b1:9692) (Quit: Textual IRC Client: www.textualapp.com)
23:21:02 × jgeerds quits (~jgeerds@55d4da80.access.ecotel.net) (Ping timeout: 268 seconds)
23:21:32 <phaazon> hm, I’m actually blocked even before trying that
23:21:41 <phaazon> I have a weird issue with implementing the data family
23:23:12 <phaazon> nevermind it’s just me being dumb
23:27:54 yates joins (~user@fv-nc-f7af8b91e1-234237-1.tingfiber.com)
23:27:56 <phaazon> awpr: yeah, that doesn’t work indeed
23:28:02 <yates> how do you exit ghci?
23:28:07 <phaazon> I need to provide the constraint, not depend on it
23:28:09 <phaazon> yates: :q
23:28:10 <yates> quit and exit won't do it.
23:29:26 <yates> phaazon: ty
23:29:47 × MQ-17J quits (~MQ-17J@d192-24-122-179.try.wideopenwest.com) (Ping timeout: 264 seconds)
23:30:06 MQ-17J joins (~MQ-17J@d192-24-122-179.try.wideopenwest.com)
23:31:30 × waleee quits (~waleee@2001:9b0:216:8200:d457:9189:7843:1dbd) (Ping timeout: 260 seconds)
23:33:11 × merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 265 seconds)
23:34:38 × MQ-17J quits (~MQ-17J@d192-24-122-179.try.wideopenwest.com) (Ping timeout: 265 seconds)
23:35:03 MQ-17J joins (~MQ-17J@d192-24-122-179.try.wideopenwest.com)
23:37:37 <phaazon> hm, with an existential I don’t seem to make it either…
23:40:35 × MQ-17J quits (~MQ-17J@d192-24-122-179.try.wideopenwest.com) (Read error: Connection reset by peer)
23:40:43 MQ-17J joins (~MQ-17J@d192-24-122-179.try.wideopenwest.com)
23:41:25 lavaman joins (~lavaman@98.38.249.169)
23:45:16 × cheater quits (~Username@user/cheater) (Ping timeout: 265 seconds)
23:45:23 × MQ-17J quits (~MQ-17J@d192-24-122-179.try.wideopenwest.com) (Ping timeout: 264 seconds)
23:45:41 MQ-17J joins (~MQ-17J@d192-24-122-179.try.wideopenwest.com)
23:46:13 libertyprime joins (~libertypr@118.149.76.0)
23:46:14 × lavaman quits (~lavaman@98.38.249.169) (Ping timeout: 265 seconds)
23:47:35 <libertyprime> Hey guys. I have a quick question about refactoring a simple bit of haskell. Here I have a function, listOf https://github.com/semiosis/ilambda/blob/master/hs/src/Main.hs#L48
23:48:06 <libertyprime> Rather than having listOfUpdate, which updates the list, I would like to combine listOf and listOfUpdate into a single function, but in a particular way
23:48:51 <libertyprime> when I'm in ghci, I'd like to be able to specify somehow to the function that I want it to update, and so use penau instead of pena
23:49:44 <libertyprime> in another language i'd introduce some global state that the function checks for
23:50:10 <libertyprime> but i'm wondering how best to do this with haskell. im too noob to know what to do
23:51:15 <libertyprime> what i would 'like' to be able to do is prefix with another function like 'upd $ listOf 5 "worst football teams"', that would look nice. something as elegant as that
23:54:55 waleee joins (~waleee@2001:9b0:216:8200:d457:9189:7843:1dbd)
23:57:22 <libertyprime> ah, but that isn't even right. forget my silly 'upd $' thought. haskell would compute the list first surely. perhaps what i need is a type on the end of listOf ... :: UpdatedList
23:57:54 <libertyprime> I have no idea how to implement that though or if it would even print in ghci. i guess i'd have to derive Show? for that type
23:57:56 × acidjnk_new3 quits (~acidjnk@p200300d0c703cb999d5eb9ee05a422b5.dip0.t-ipconnect.de) (Ping timeout: 246 seconds)

All times are in UTC on 2021-10-15.