2022/10/31

2022-10-31 00:00:11 +0100eggplantade(~Eggplanta@2600:1700:38c5:d800:7552:8274:e242:b93b)
2022-10-31 00:01:17 +0100potash(~foghorn@user/foghorn) (Quit: ZNC 1.8.2 - https://znc.in)
2022-10-31 00:07:26 +0100freeside(~mengwong@bb115-66-48-84.singnet.com.sg)
2022-10-31 00:11:27 +0100Dev-Inchy22(~Dev-Inchy@136.144.35.102)
2022-10-31 00:11:33 +0100danza(~francesco@22.red-79-153-42.dynamicip.rima-tde.net)
2022-10-31 00:11:38 +0100Dev-Inchy(~Dev-Inchy@136.144.35.93) (Ping timeout: 246 seconds)
2022-10-31 00:21:01 +0100Dev-Inchy22(~Dev-Inchy@136.144.35.102) (Ping timeout: 252 seconds)
2022-10-31 00:22:09 +0100apache2(apache2@anubis.0x90.dk) (Ping timeout: 255 seconds)
2022-10-31 00:26:41 +0100nate3(~nate@98.45.169.16) (Ping timeout: 246 seconds)
2022-10-31 00:33:28 +0100Kaipei(~Kaiepi@108.175.84.104)
2022-10-31 00:35:56 +0100seriley_(~seriley@97-120-69-62.ptld.qwest.net) (Quit: Leaving)
2022-10-31 00:36:58 +0100Kaiepi(~Kaiepi@108.175.84.104) (Ping timeout: 252 seconds)
2022-10-31 00:40:21 +0100merijn(~merijn@86-86-29-250.fixed.kpn.net)
2022-10-31 00:41:27 +0100hamster(~ham@user/ham) (Quit: WeeChat 3.5)
2022-10-31 00:42:08 +0100ham(~ham@user/ham)
2022-10-31 00:44:52 +0100merijn(~merijn@86-86-29-250.fixed.kpn.net) (Ping timeout: 248 seconds)
2022-10-31 00:50:00 +0100beteigeuze(~Thunderbi@bl14-81-220.dsl.telepac.pt) (Remote host closed the connection)
2022-10-31 00:50:12 +0100beteigeuze(~Thunderbi@bl14-81-220.dsl.telepac.pt)
2022-10-31 00:51:52 +0100Tuplanolla(~Tuplanoll@91-159-69-11.elisa-laajakaista.fi) (Quit: Leaving.)
2022-10-31 00:53:06 +0100tremon(~tremon@83-84-18-241.cable.dynamic.v4.ziggo.nl) (Quit: getting boxed in)
2022-10-31 00:53:56 +0100bitmapper(uid464869@id-464869.lymington.irccloud.com)
2022-10-31 00:54:31 +0100j4cc3b(~j4cc3b@2601:98a:4200:4515:a590:a925:a8ca:78b7) (Ping timeout: 244 seconds)
2022-10-31 01:09:10 +0100nate3(~nate@98.45.169.16)
2022-10-31 01:11:37 +0100freeside(~mengwong@bb115-66-48-84.singnet.com.sg) (Ping timeout: 252 seconds)
2022-10-31 01:14:12 +0100nate3(~nate@98.45.169.16) (Ping timeout: 248 seconds)
2022-10-31 01:17:42 +0100 <cheater> hi
2022-10-31 01:17:50 +0100 <Axman6> o/
2022-10-31 01:17:56 +0100 <cheater> what's your favourite way to write gen :: [a] -> IO a?
2022-10-31 01:18:11 +0100 <cheater> spits out the next a every time it gets called, until there are no more
2022-10-31 01:18:45 +0100 <Axman6> what happens when it's called and there's nothing left?
2022-10-31 01:18:59 +0100 <cheater> idk, let's say it repeats
2022-10-31 01:19:15 +0100 <cheater> so then there's always something left
2022-10-31 01:19:17 +0100 <Axman6> IMO the type should be gen :: [a] -> IO (IO a)
2022-10-31 01:19:27 +0100skiwas just about to say
2022-10-31 01:19:31 +0100hamhamster
2022-10-31 01:19:32 +0100 <cheater> why
2022-10-31 01:19:37 +0100 <dsal> You need a generator generator. It can close over an IORef and cycle the input.
2022-10-31 01:19:45 +0100 <ski> because it needs to initialize an `IORef'
2022-10-31 01:19:57 +0100 <cheater> i was thinking of using an IORef, yes
2022-10-31 01:20:24 +0100 <cheater> but i was hoping someone else had a better idea
2022-10-31 01:20:55 +0100 <cheater> though I was going to do something like gen :: [a] -> IORef Int -> IO a
2022-10-31 01:21:06 +0100 <cheater> but it doesn't really matter
2022-10-31 01:21:20 +0100 <chromoblob> how is Integer implemented in GHC?
2022-10-31 01:21:28 +0100 <ski> then the caller could potentially pass in a different `IORef Int', on different calls
2022-10-31 01:21:31 +0100 <Axman6> gen xs = do { ref <- newIORef xs; pure (do { ys <- readIORef ref; case ys of [a] -> pure a; (z:zs) -> do { writeIORef ref zs; pure z}; _ -> error "oh no}}
2022-10-31 01:21:42 +0100 <cheater> yes, ski, that is possible. it doesn't bother me
2022-10-31 01:21:59 +0100 <ski> % :i Integer
2022-10-31 01:22:00 +0100 <yahb2> type Integer :: * ; data Integer ; = GHC.Num.Integer.IS GHC.Prim.Int# ; | GHC.Num.Integer.IP GHC.Prim.ByteArray# ; | GHC.Num.Integer.IN GHC.Prim.ByteArray# ; -- Defined in ‘GHC.Num.Integer...
2022-10-31 01:22:15 +0100 <ski> chromoblob ^
2022-10-31 01:23:34 +0100perrierjouet(~perrier-j@modemcable048.127-56-74.mc.videotron.ca) (Quit: WeeChat 3.7.1)
2022-10-31 01:23:53 +0100 <ski> cheater : there's no need to leak implementation details, though
2022-10-31 01:24:20 +0100 <geekosaur> more to the point, it's usually backed by GMP (there is an option for a slower native Haskell implementation, for those who prefer to avoid touching the GPL — mostly corporate users)
2022-10-31 01:24:35 +0100 <ski> Axman6's snippet is how to do it. except if you wanted to cycle, you'd modify accordingly
2022-10-31 01:24:58 +0100 <Axman6> IIRC it's not always slower, some operations are faster because of the efficient encoding of small values and signs
2022-10-31 01:25:09 +0100chomwitt(~chomwitt@2a02:587:dc18:4a00:1ac0:4dff:fedb:a3f1) (Ping timeout: 246 seconds)
2022-10-31 01:26:40 +0100 <Axman6> ByteArray# is nearly identical to the representation used by GMP (I was sure it used WordArray# though...)
2022-10-31 01:27:52 +0100 <dsal> I think I ran into two or three bugs caused by postgresql-simple trying to avoid using libpq normal parameter binding. I can't work around one of them so that's unfortunate.
2022-10-31 01:28:45 +0100 <Axman6> I've always prefered hasql - but mostly for performance reasons
2022-10-31 01:29:49 +0100 <dsal> I'm using sqlite-simple in this project and could copy and paste most of the implementation to get postgres working. Except for the parts that don't work. The way I built this abstraction, though, nothing outside of this one file knows anything about how it talks to postgres.
2022-10-31 01:30:18 +0100freeside(~mengwong@bb115-66-48-84.singnet.com.sg)
2022-10-31 01:31:01 +0100nate3(~nate@98.45.169.16)
2022-10-31 01:32:33 +0100 <[Leary]> % :t \xs -> newIORef (cycle xs) <&> \ref -> atomicModifyIORef ref \(h:t) -> (t,h)
2022-10-31 01:32:34 +0100 <yahb2> \xs -> newIORef (cycle xs) <&> \ref -> atomicModifyIORef ref \(h:t) -> (t,h) ; :: [b] -> IO (IO b)
2022-10-31 01:32:43 +0100 <[Leary]> cheater: I wrote one of these just recently. ^
2022-10-31 01:32:58 +0100 <[Leary]> Though it's better to use a `cycle :: NonEmpty a -> Stream a`.
2022-10-31 01:34:01 +0100 <dsal> Yeah, `NonEmpty` + `cycle` is a good call.
2022-10-31 01:34:41 +0100 <cheater> neat :) thanks
2022-10-31 01:36:04 +0100nate3(~nate@98.45.169.16) (Ping timeout: 248 seconds)
2022-10-31 01:57:16 +0100mixfix41(~sdeny9ee@user/mixfix41) (Ping timeout: 252 seconds)
2022-10-31 01:59:53 +0100causal(~user@50.35.83.177)
2022-10-31 02:04:24 +0100emmanuelux(~emmanuelu@user/emmanuelux) (Quit: au revoir)
2022-10-31 02:10:13 +0100perrierjouet(~perrier-j@modemcable048.127-56-74.mc.videotron.ca)
2022-10-31 02:11:43 +0100albet70(~xxx@2400:8902::f03c:92ff:fe60:98d8) (Remote host closed the connection)
2022-10-31 02:17:51 +0100albet70(~xxx@2400:8902::f03c:92ff:fe60:98d8)
2022-10-31 02:23:49 +0100Feuermagier(~Feuermagi@user/feuermagier) (Remote host closed the connection)
2022-10-31 02:24:12 +0100Feuermagier(~Feuermagi@user/feuermagier)
2022-10-31 02:26:16 +0100 <yin> how are records represented internally? is getting/setting record fields always preferable to maps?
2022-10-31 02:27:26 +0100gurkenglas(~gurkengla@p548ac72e.dip0.t-ipconnect.de) (Ping timeout: 246 seconds)
2022-10-31 02:27:54 +0100 <c_wraith> Not if the record has 1000 fields
2022-10-31 02:29:28 +0100 <c_wraith> anyway. GHC's runtime representation of a record is a header then... usually pointers to every value. (Usually because sometimes fields get unpacked so they're stored directly in the record)
2022-10-31 02:29:46 +0100 <c_wraith> Updating a record is copying all of it except for the field you're updating.
2022-10-31 02:32:59 +0100waleee(~waleee@2001:9b0:213:7200:cc36:a556:b1e8:b340) (Ping timeout: 276 seconds)
2022-10-31 02:34:44 +0100freeside(~mengwong@bb115-66-48-84.singnet.com.sg) (Ping timeout: 248 seconds)
2022-10-31 02:37:35 +0100mokee(~mokee@37.228.215.235) (Quit: off)
2022-10-31 02:39:13 +0100mokee(~mokee@37.228.215.235)
2022-10-31 02:39:41 +0100nate3(~nate@98.45.169.16)
2022-10-31 02:40:51 +0100freeside(~mengwong@bb115-66-48-84.singnet.com.sg)
2022-10-31 02:41:13 +0100merijn(~merijn@86-86-29-250.fixed.kpn.net)
2022-10-31 02:41:40 +0100motherfsck(~motherfsc@user/motherfsck) (Ping timeout: 248 seconds)
2022-10-31 02:41:43 +0100qrpnxz(~qrpnxz@fsf/member/qrpnxz) (Read error: Connection reset by peer)
2022-10-31 02:42:49 +0100ham2(~ham@user/ham)
2022-10-31 02:44:20 +0100nate3(~nate@98.45.169.16) (Ping timeout: 248 seconds)
2022-10-31 02:44:44 +0100Lord_of_Life(~Lord@user/lord-of-life/x-2819915) (Ping timeout: 250 seconds)
2022-10-31 02:45:24 +0100freeside(~mengwong@bb115-66-48-84.singnet.com.sg) (Ping timeout: 248 seconds)
2022-10-31 02:45:40 +0100hamster(~ham@user/ham) (Ping timeout: 252 seconds)
2022-10-31 02:46:02 +0100Lord_of_Life(~Lord@user/lord-of-life/x-2819915)
2022-10-31 02:51:00 +0100 <yin> ouch. why not just update the pointer?
2022-10-31 02:51:20 +0100beteigeuze(~Thunderbi@bl14-81-220.dsl.telepac.pt) (Remote host closed the connection)
2022-10-31 02:51:35 +0100beteigeuze(~Thunderbi@bl14-81-220.dsl.telepac.pt)
2022-10-31 02:51:40 +0100 <c_wraith> because that violates purity
2022-10-31 02:51:41 +0100 <ski> how would that work ?
2022-10-31 02:52:08 +0100 <c_wraith> well. it violates immutability, more directly
2022-10-31 02:55:43 +0100mmhat(~mmh@p200300f1c730765eee086bfffe095315.dip0.t-ipconnect.de) (Quit: WeeChat 3.7.1)
2022-10-31 02:57:14 +0100 <Axman6> GHC could make thew optimisation with linear types, but AFAIK it doesn't currently do so
2022-10-31 02:57:21 +0100jero98772(~jero98772@2800:484:1d80:d8ce:3490:26c5:1782:da8c)
2022-10-31 02:57:30 +0100 <Axman6> that*
2022-10-31 03:03:16 +0100beteigeuze(~Thunderbi@bl14-81-220.dsl.telepac.pt) (Ping timeout: 252 seconds)
2022-10-31 03:04:21 +0100 <[Leary]> You could feasibly make all your fields explicit references, then construct a pure linear interface to the type after the fact (with liberal application of unsafeCoerce and unsafePerformIO).
2022-10-31 03:04:54 +0100 <Axman6> sounds like edwardk's structs package
2022-10-31 03:05:08 +0100freeside(~mengwong@bb115-66-48-84.singnet.com.sg)
2022-10-31 03:06:21 +0100perrierjouet(~perrier-j@modemcable048.127-56-74.mc.videotron.ca) (Quit: WeeChat 3.7.1)
2022-10-31 03:10:29 +0100freeside(~mengwong@bb115-66-48-84.singnet.com.sg) (Ping timeout: 246 seconds)
2022-10-31 03:13:42 +0100 <Axman6> yin: in general "changing" a field in a record is pretty cheap, it's just a memcpy of a known size and then each modified field is set. There isn't really any way around that because of the immutability of all Haskell data types. But we do also get the benefit that sharing is always safe, so if you want to store the entire history of your app, the bare minimum is copied
2022-10-31 03:14:20 +0100merijn(~merijn@86-86-29-250.fixed.kpn.net) (Ping timeout: 246 seconds)
2022-10-31 03:21:46 +0100 <yin> i get it
2022-10-31 03:23:54 +0100freeside(~mengwong@bb115-66-48-84.singnet.com.sg)
2022-10-31 03:26:12 +0100[_](~itchyjunk@user/itchyjunk/x-7353470)
2022-10-31 03:26:28 +0100sadmax(~user@209.205.174.253)
2022-10-31 03:28:09 +0100jargon(~jargon@184.101.77.52) (Remote host closed the connection)
2022-10-31 03:28:42 +0100[itchyjunk](~itchyjunk@user/itchyjunk/x-7353470) (Ping timeout: 246 seconds)
2022-10-31 03:30:56 +0100[_](~itchyjunk@user/itchyjunk/x-7353470) (Read error: Connection reset by peer)
2022-10-31 03:33:09 +0100perrierjouet(~perrier-j@modemcable048.127-56-74.mc.videotron.ca)
2022-10-31 03:45:08 +0100ddellacosta(~ddellacos@89.45.224.130) (Ping timeout: 248 seconds)
2022-10-31 04:04:20 +0100sadmax(~user@209.205.174.253) (Ping timeout: 248 seconds)
2022-10-31 04:05:49 +0100jmorris(uid537181@id-537181.uxbridge.irccloud.com)
2022-10-31 04:06:15 +0100werneta(~werneta@70-142-214-115.lightspeed.irvnca.sbcglobal.net) (Ping timeout: 272 seconds)
2022-10-31 04:07:39 +0100werneta(~werneta@70-142-214-115.lightspeed.irvnca.sbcglobal.net)
2022-10-31 04:09:14 +0100jero98772(~jero98772@2800:484:1d80:d8ce:3490:26c5:1782:da8c) (Remote host closed the connection)
2022-10-31 04:09:23 +0100bilegeek(~bilegeek@2600:1008:b016:9b40:9349:658c:37b9:deaf) (Remote host closed the connection)
2022-10-31 04:09:52 +0100bilegeek(~bilegeek@2600:1008:b016:9b40:9349:658c:37b9:deaf)
2022-10-31 04:15:00 +0100werneta(~werneta@70-142-214-115.lightspeed.irvnca.sbcglobal.net) (Ping timeout: 248 seconds)
2022-10-31 04:15:16 +0100nate3(~nate@98.45.169.16)
2022-10-31 04:15:36 +0100jao(~jao@cpc103048-sgyl39-2-0-cust502.18-2.cable.virginm.net) (Ping timeout: 246 seconds)
2022-10-31 04:16:55 +0100werneta(~werneta@70-142-214-115.lightspeed.irvnca.sbcglobal.net)
2022-10-31 04:19:27 +0100machinedgod(~machinedg@d198-53-218-113.abhsia.telus.net) (Quit: Lost terminal)
2022-10-31 04:25:37 +0100Feuermagier_(~Feuermagi@154.28.188.170)
2022-10-31 04:26:19 +0100freeside(~mengwong@bb115-66-48-84.singnet.com.sg) (Ping timeout: 252 seconds)
2022-10-31 04:27:57 +0100td_(~td@83.135.9.47) (Ping timeout: 240 seconds)
2022-10-31 04:28:31 +0100Feuermagier(~Feuermagi@user/feuermagier) (Ping timeout: 252 seconds)
2022-10-31 04:29:23 +0100mvk(~mvk@2607:fea8:5ce3:8500::f30b)
2022-10-31 04:29:57 +0100td_(~td@83.135.9.57)
2022-10-31 04:34:54 +0100chexum_(~quassel@gateway/tor-sasl/chexum) (Remote host closed the connection)
2022-10-31 04:35:10 +0100chexum(~quassel@gateway/tor-sasl/chexum)
2022-10-31 04:38:28 +0100werneta(~werneta@70-142-214-115.lightspeed.irvnca.sbcglobal.net) (Ping timeout: 248 seconds)
2022-10-31 04:40:37 +0100dzdcnfzd(~dzdcnfzd@pool-72-69-177-248.nycmny.fios.verizon.net)
2022-10-31 04:43:38 +0100Dev-Inchy(~Dev-Inchy@136.144.35.100)
2022-10-31 04:43:52 +0100Dev-Inchy(~Dev-Inchy@136.144.35.100) (Client Quit)
2022-10-31 04:47:13 +0100freeside(~mengwong@bb115-66-48-84.singnet.com.sg)
2022-10-31 04:47:43 +0100werneta(~werneta@70-142-214-115.lightspeed.irvnca.sbcglobal.net)
2022-10-31 04:48:19 +0100Lord_of_Life(~Lord@user/lord-of-life/x-2819915) (Ping timeout: 252 seconds)
2022-10-31 04:49:37 +0100Lord_of_Life(~Lord@user/lord-of-life/x-2819915)
2022-10-31 04:53:30 +0100nate3(~nate@98.45.169.16) (Ping timeout: 255 seconds)
2022-10-31 04:53:40 +0100ezzieyguywuf(~Unknown@user/ezzieyguywuf) (Remote host closed the connection)
2022-10-31 04:56:54 +0100FinnElija(~finn_elij@user/finn-elija/x-0085643) (Killed (NickServ (Forcing logout FinnElija -> finn_elija)))
2022-10-31 04:56:54 +0100finn_elija(~finn_elij@user/finn-elija/x-0085643)
2022-10-31 04:56:54 +0100finn_elijaFinnElija
2022-10-31 04:58:41 +0100ezzieyguywuf(~Unknown@user/ezzieyguywuf)
2022-10-31 05:03:32 +0100werneta(~werneta@70-142-214-115.lightspeed.irvnca.sbcglobal.net) (Ping timeout: 248 seconds)
2022-10-31 05:05:07 +0100werneta(~werneta@70-142-214-115.lightspeed.irvnca.sbcglobal.net)
2022-10-31 05:06:08 +0100mbuf(~Shakthi@49.204.120.214)
2022-10-31 05:11:25 +0100merijn(~merijn@86-86-29-250.fixed.kpn.net)
2022-10-31 05:13:40 +0100werneta(~werneta@70-142-214-115.lightspeed.irvnca.sbcglobal.net) (Ping timeout: 248 seconds)
2022-10-31 05:15:41 +0100jlgw_(~jw@83-233-104-81.cust.bredband2.com) (Remote host closed the connection)
2022-10-31 05:17:23 +0100bilegeek(~bilegeek@2600:1008:b016:9b40:9349:658c:37b9:deaf) (Remote host closed the connection)
2022-10-31 05:17:23 +0100Guest38(~Guest38@76.128.170.130)
2022-10-31 05:18:08 +0100bilegeek(~bilegeek@2600:1008:b016:9b40:9349:658c:37b9:deaf)
2022-10-31 05:20:48 +0100 <chromoblob> i recently had an epiphany
2022-10-31 05:20:52 +0100 <chromoblob> an application of a lambda to arguments is like a coroutine with state = these arguments
2022-10-31 05:21:16 +0100 <chromoblob> if lambda returns application of constructor, then the coroutine returns the tag of the constructor
2022-10-31 05:21:37 +0100werneta(~werneta@70-142-214-115.lightspeed.irvnca.sbcglobal.net)
2022-10-31 05:21:42 +0100 <chromoblob> if constructor has more than one field, coroutine splits into two or more coroutines
2022-10-31 05:22:46 +0100 <chromoblob> a scheme for compilation of fp language can be based on that
2022-10-31 05:26:14 +0100freeside_(~mengwong@bb115-66-48-84.singnet.com.sg)
2022-10-31 05:27:22 +0100freeside(~mengwong@bb115-66-48-84.singnet.com.sg) (Ping timeout: 252 seconds)
2022-10-31 05:30:15 +0100 <chromoblob> if constructor has no fields, the coroutine ends
2022-10-31 05:31:22 +0100zebrag(~chris@user/zebrag) (Quit: Konversation terminated!)
2022-10-31 05:31:50 +0100 <chromoblob> cool thing with Haskell and such is that you can specify how coroutine's return type will change over "invocations"
2022-10-31 05:32:55 +0100 <chromoblob> that it will change at all, too
2022-10-31 05:33:20 +0100 <chromoblob> so Haskell is just splitting coroutines :p
2022-10-31 05:36:27 +0100 <c_wraith> describing it in terms of coroutines sounds a bit indirect to me.
2022-10-31 05:36:30 +0100 <c_wraith> It's just functions
2022-10-31 05:37:45 +0100bitmapper(uid464869@id-464869.lymington.irccloud.com) (Quit: Connection closed for inactivity)
2022-10-31 05:38:23 +0100bilegeek(~bilegeek@2600:1008:b016:9b40:9349:658c:37b9:deaf) (Remote host closed the connection)
2022-10-31 05:38:51 +0100bilegeek(~bilegeek@2600:1008:b016:9b40:9349:658c:37b9:deaf)
2022-10-31 05:40:23 +0100 <chromoblob> c_wraith: they are like coroutines in that values are returned bit by bit rather than entirely in one step, in other wordOCs, codata
2022-10-31 05:40:35 +0100 <chromoblob> in other words *
2022-10-31 05:43:29 +0100redmp(~redmp@mobile-166-170-43-64.mycingular.net)
2022-10-31 05:45:32 +0100merijn(~merijn@86-86-29-250.fixed.kpn.net) (Ping timeout: 246 seconds)
2022-10-31 05:47:06 +0100 <ski> in Charity, function (exponential) type can be specified as something like `codata S -> (A => B) where apply : S * A -> B' (which gives the morphism `apply : (A => B) * A -> B' for elimination. for introduction, you construct a morphism in `S -> (A => B)' by putting in a morphism in `S * A -> B')
2022-10-31 05:47:07 +0100Vajb(~Vajb@2001:999:504:1841:9e47:1ec7:a52e:1d57) (Read error: Connection reset by peer)
2022-10-31 05:48:16 +0100Vajb(~Vajb@hag-jnsbng11-58c3a5-27.dhcp.inet.fi)
2022-10-31 05:49:12 +0100 <ski> in a similar way, you can specify a synchronous stream processor type by `codata S -> ssp(A,B) where step : S * A -> S * B' (giving elimination morphism `step : ssp(A,B) * A -> ssp(A,B) * B', so you get a new "coroutine" state together with the output in `B', so that you can feed another `A' as input and repeat)
2022-10-31 05:49:34 +0100Axman6has no idea what anyone is on about at the moment
2022-10-31 05:50:01 +0100 <Axman6> All's I know is I likes my Haskell and I likes it lazy!
2022-10-31 05:50:43 +0100 <chromoblob> coroutineness *is* laziness
2022-10-31 05:50:51 +0100 <ski> (in Haskell, the corresponding type could be declared as `data SSP a b = MkSSP {step :: a -> (SSP a b,b)}' or as `data SSP a b = forall s. MkSSP s (s -> a -> (s,b))')
2022-10-31 05:50:57 +0100 <Axman6> I don't believe that's true chromoblob
2022-10-31 05:51:06 +0100 <chromoblob> but why
2022-10-31 05:52:02 +0100 <Axman6> Well for one, giving something a name in a lazy language ensure it will only be evaluated once (possibly more but that's a side effect of concurrency). I don't know of any coroutine-y things which do that
2022-10-31 05:54:07 +0100 <Axman6> but also that the named thing may not be evaluated at all - generally evaluating a coroutine, correct me if I'm wrong, would need to be evaluated to be given the name, or would need to be re-evaluated each time its value was needed
2022-10-31 05:55:43 +0100dzdcnfzd(~dzdcnfzd@pool-72-69-177-248.nycmny.fios.verizon.net) (Quit: Client closed)
2022-10-31 05:55:55 +0100 <ski> (i'm probably botching the syntax in Charity somewhat .. but that's basically how you do right/codata (and dually left/data) types, in it. anyway, point being that the function type `A => B' isn't really like a coroutine type there, if you want to think of the coroutine as progressing by successively supplying it with arguments. otoh, the `ssp(A,B)' type is a bit like a coroutine that you successively feed
2022-10-31 05:56:01 +0100 <ski> `A's as inputs, and get corresponding `B's as outputs)
2022-10-31 05:58:02 +0100 <ski> @where Charity
2022-10-31 05:58:02 +0100 <lambdabot> http://pll.cpsc.ucalgary.ca/charity1/www/home.html
2022-10-31 05:59:46 +0100eL_Bart0(eL_Bart0@dietunichtguten.org) (Ping timeout: 252 seconds)
2022-10-31 06:00:50 +0100 <ski> <http://pll.cpsc.ucalgary.ca/charity1/download/examples/prelude/exp.ch> resp. <http://pll.cpsc.ucalgary.ca/charity1/download/examples/misc/proc.ch> are the two Charity types i was remembering the idea, but not the concrete syntax, of
2022-10-31 06:04:50 +0100 <chromoblob> yeah, you need to overwrite a pointer to coroutine state (application of lambda) with a pointer to record holding the constructor and fields, after which reevaluation shouldn't happen
2022-10-31 06:05:39 +0100 <chromoblob> that is if a variable which is bound to this is needed somewhere later on
2022-10-31 06:05:56 +0100eL_Bart0(eL_Bart0@dietunichtguten.org)
2022-10-31 06:07:39 +0100 <chromoblob> i think you need a pointer and a bit, bit = 0 -> pointer is to application of lambda, bit = 1 -> pointer is to constructed value
2022-10-31 06:08:22 +0100 <chromoblob> if bit unset, go evaluate; if bit set, do nothing; now, value is evaluated.
2022-10-31 06:10:08 +0100 <chromoblob> next state(s) of the coroutine can be found in the value's field(s)
2022-10-31 06:11:54 +0100 <chromoblob> multiple if it forks
2022-10-31 06:15:03 +0100Spukgespenst(~user@user/siracusa) (Quit: Bye!)
2022-10-31 06:18:14 +0100 <ski> forks ?
2022-10-31 06:18:42 +0100 <chromoblob> data T = Datum Int | Fork (T, T)
2022-10-31 06:18:44 +0100freeside_(~mengwong@bb115-66-48-84.singnet.com.sg) (Ping timeout: 248 seconds)
2022-10-31 06:18:55 +0100 <chromoblob> coroutine forks into two
2022-10-31 06:19:26 +0100 <chromoblob> oops, i meant data T = Datum Int T | Fork (T, T)
2022-10-31 06:19:50 +0100 <chromoblob> so at each step a T either gives an Int or forks into two T's
2022-10-31 06:20:42 +0100 <chromoblob> and type-level arguments are typestate... coolness
2022-10-31 06:21:13 +0100 <ski> hm, a tree with unary and binary nodes, and `Int's in the unary nodes
2022-10-31 06:21:35 +0100redmp(~redmp@mobile-166-170-43-64.mycingular.net) (Ping timeout: 246 seconds)
2022-10-31 06:21:51 +0100 <chromoblob> not just a tree, i stress that it is lazily computed and returned bit by bit
2022-10-31 06:22:20 +0100 <ski> could also be represented as `exists t. t * (t -> Int * t + t * t)'
2022-10-31 06:23:35 +0100 <ski> (it being lazily computed goes without saying, with a lazy implementation of Haskell, and the bit by bit just comes from the non-strictness of Haskell)
2022-10-31 06:24:45 +0100 <ski> where does the forking fit in to what you were talking about previously ? or perhaps it didn't really, was just something you were reminded of, for coroutines in general ?
2022-10-31 06:25:58 +0100dsrt^(~dsrt@76.145.185.103) (Remote host closed the connection)
2022-10-31 06:26:01 +0100 <ski> (at first, the bit you were talking about sounded like the bit telling whether you have an evaluated (and cached) thunk, or a still unevaluated one)
2022-10-31 06:27:50 +0100 <chromoblob> an evaluated value is a record with a constructor tag and multiple pointers pointing to coroutine states into which the old coroutine forked
2022-10-31 06:30:11 +0100 <chromoblob> recursive value definitions also allow us to specify that a coroutine "loops forever" on one of its fork-tos
2022-10-31 06:33:18 +0100Vajb(~Vajb@hag-jnsbng11-58c3a5-27.dhcp.inet.fi) (Read error: Connection reset by peer)
2022-10-31 06:33:40 +0100Vajb(~Vajb@2001:999:504:1841:9e47:1ec7:a52e:1d57)
2022-10-31 06:34:18 +0100detuneattune(~detuneatt@user/detuneattune) (Quit: The Lounge - https://thelounge.chat)
2022-10-31 06:38:15 +0100Luj3(~Luj@2a01:e0a:5f9:9681:a8ec:74c1:b9fd:4789)
2022-10-31 06:38:48 +0100mvk(~mvk@2607:fea8:5ce3:8500::f30b) (Ping timeout: 255 seconds)
2022-10-31 06:43:48 +0100eL_Bart0(eL_Bart0@dietunichtguten.org) (Ping timeout: 248 seconds)
2022-10-31 06:43:53 +0100detuneattune(~detuneatt@user/detuneattune)
2022-10-31 06:46:07 +0100 <ski> mhm
2022-10-31 06:49:49 +0100 <chromoblob> haskell is just a really concise language for programming with coroutines-in-this-sense
2022-10-31 06:51:25 +0100 <chromoblob> let x = 1:2:3:x in x, how many lines of code would you need to express this in imperative languages
2022-10-31 06:52:04 +0100Lord_of_Life(~Lord@user/lord-of-life/x-2819915) (Ping timeout: 252 seconds)
2022-10-31 06:52:06 +0100 <chromoblob> if the language directly supports coroutines, it's better, though
2022-10-31 06:53:27 +0100 <chromoblob> but the typestates and forking, uber abilities
2022-10-31 06:53:44 +0100Lord_of_Life(~Lord@user/lord-of-life/x-2819915)
2022-10-31 06:55:32 +0100kenran(~user@user/kenran)
2022-10-31 06:55:34 +0100kenran(~user@user/kenran) (Remote host closed the connection)
2022-10-31 07:05:36 +0100vglfr(~vglfr@145.224.100.22)
2022-10-31 07:07:21 +0100mixfix41(~sdeny9ee@user/mixfix41)
2022-10-31 07:08:11 +0100troydm(~troydm@host-176-37-124-197.b025.la.net.ua) (Ping timeout: 260 seconds)
2022-10-31 07:18:02 +0100chomwitt(~chomwitt@2a02:587:dc18:4a00:1ac0:4dff:fedb:a3f1)
2022-10-31 07:21:50 +0100 <EvanR> x = 1:2:3:x more like codata than coroutine right
2022-10-31 07:23:44 +0100 <chromoblob> what's the difference?
2022-10-31 07:25:04 +0100werneta(~werneta@70-142-214-115.lightspeed.irvnca.sbcglobal.net) (Ping timeout: 252 seconds)
2022-10-31 07:25:17 +0100werneta(~werneta@70-142-214-115.lightspeed.irvnca.sbcglobal.net)
2022-10-31 07:28:19 +0100 <c_wraith> like... [a] matches up with one definition of a coroutine. But what does an infinite lazy binary tree match up with?
2022-10-31 07:29:32 +0100 <chromoblob> with a coroutine which can fork, returning two instances of coroutine state instead of one
2022-10-31 07:29:42 +0100 <c_wraith> or... with codata.
2022-10-31 07:29:52 +0100 <c_wraith> throw out coroutines. they don't do that.
2022-10-31 07:29:55 +0100 <c_wraith> just use codata
2022-10-31 07:30:54 +0100 <c_wraith> In fact, a coroutine is bad version of even [a], as [a] can remember previous results.
2022-10-31 07:31:30 +0100azimut(~azimut@gateway/tor-sasl/azimut) (Ping timeout: 258 seconds)
2022-10-31 07:31:51 +0100 <chromoblob> "memoized forking coroutines" i suppose i really like coroutines, i just extend them to match what happens in Haskell
2022-10-31 07:32:05 +0100 <c_wraith> right. why burden yourself with that mental overhead?
2022-10-31 07:32:15 +0100 <c_wraith> things are allowed to just be different
2022-10-31 07:32:38 +0100 <chromoblob> it's not overhead, it's a kind of deep understanding
2022-10-31 07:35:10 +0100 <chromoblob> things are not just different, if a thing is an understood modification of another thing then i can understand thing in terms of that other thing
2022-10-31 07:36:20 +0100 <chromoblob> this notion of coroutines helps me see that there is nothing magical in Haskell's entities
2022-10-31 07:36:40 +0100 <chromoblob> and helps me implement a functional language
2022-10-31 07:42:03 +0100merijn(~merijn@86-86-29-250.fixed.kpn.net)
2022-10-31 07:42:19 +0100michalz(~michalz@185.246.207.221)
2022-10-31 07:46:00 +0100Guest38(~Guest38@76.128.170.130) (Quit: Client closed)
2022-10-31 07:47:15 +0100coot(~coot@2a02:a310:e241:1b00:ec1a:e9df:79ac:66ba)
2022-10-31 08:13:51 +0100Guest42(~Guest42@41.59.37.224)
2022-10-31 08:16:36 +0100merijn(~merijn@86-86-29-250.fixed.kpn.net) (Ping timeout: 248 seconds)
2022-10-31 08:22:46 +0100merijn(~merijn@86-86-29-250.fixed.kpn.net)
2022-10-31 08:34:15 +0100tromp(~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl)
2022-10-31 08:35:36 +0100jmorris(uid537181@id-537181.uxbridge.irccloud.com) (Quit: Connection closed for inactivity)
2022-10-31 08:37:59 +0100asm(~alexander@burner.asm89.io) (Changing host)
2022-10-31 08:37:59 +0100asm(~alexander@user/asm)
2022-10-31 08:44:36 +0100jtomas(~jtomas@191.red-88-17-199.dynamicip.rima-tde.net)
2022-10-31 08:44:51 +0100Sgeo_(~Sgeo@user/sgeo) (Read error: Connection reset by peer)
2022-10-31 08:49:15 +0100acidjnk(~acidjnk@p200300d6e7137a70ac64450b6466d6c8.dip0.t-ipconnect.de)
2022-10-31 08:50:24 +0100machinedgod(~machinedg@d198-53-218-113.abhsia.telus.net)
2022-10-31 08:52:42 +0100mmhat(~mmh@p200300f1c730765eee086bfffe095315.dip0.t-ipconnect.de)
2022-10-31 09:03:13 +0100gmg(~user@user/gehmehgeh)
2022-10-31 09:06:57 +0100eggplantade(~Eggplanta@2600:1700:38c5:d800:7552:8274:e242:b93b) (Remote host closed the connection)
2022-10-31 09:07:41 +0100bilegeek(~bilegeek@2600:1008:b016:9b40:9349:658c:37b9:deaf) (Quit: Leaving)
2022-10-31 09:07:54 +0100zeenk(~zeenk@2a02:2f04:a105:5d00:c862:f190:2ea:d494)
2022-10-31 09:08:01 +0100gmg(~user@user/gehmehgeh) (Remote host closed the connection)
2022-10-31 09:08:43 +0100gmg(~user@user/gehmehgeh)
2022-10-31 09:12:21 +0100 <cheater> any good way of taking this out of IO? https://paste.tomsmeding.com/OMGavsPG
2022-10-31 09:14:00 +0100CiaoSen(~Jura@p200300c9570c54002a3a4dfffe84dbd5.dip0.t-ipconnect.de)
2022-10-31 09:15:16 +0100mixfix41(~sdeny9ee@user/mixfix41) (Ping timeout: 248 seconds)
2022-10-31 09:16:53 +0100freeside(~mengwong@bb115-66-48-84.singnet.com.sg)
2022-10-31 09:18:47 +0100Guest42(~Guest42@41.59.37.224) (Ping timeout: 244 seconds)
2022-10-31 09:23:48 +0100freeside(~mengwong@bb115-66-48-84.singnet.com.sg) (Ping timeout: 248 seconds)
2022-10-31 09:24:22 +0100Midjak(~Midjak@82.66.147.146)
2022-10-31 09:24:33 +0100Teacup_(~teacup@user/teacup) (Quit: Teacup_)
2022-10-31 09:28:47 +0100 <merijn> no?
2022-10-31 09:29:01 +0100 <merijn> There's never a *good* way to take things out of IO
2022-10-31 09:29:46 +0100 <cheater> as in make the loop a pure function
2022-10-31 09:30:12 +0100schweers(~user@p200300e5773c9a00c23ebafffe9bd9c9.dip0.t-ipconnect.de)
2022-10-31 09:30:23 +0100Guest42(~Guest42@41.59.37.224)
2022-10-31 09:33:21 +0100Guest42(~Guest42@41.59.37.224) (Client Quit)
2022-10-31 09:34:51 +0100 <opqdonut> cheater: I assume getAIO should be getFooIO? in that case, the number of calls to getFooIO depends on the result of getFooIO, so you can't purify the loop
2022-10-31 09:34:56 +0100 <cheater> rec is actually :: (IO FooM) -> ... where FooM is Either MyError (MyNormal Foo)
2022-10-31 09:34:59 +0100 <opqdonut> it's a "true" monadic computation
2022-10-31 09:35:06 +0100 <cheater> opqdonut: yes, it should
2022-10-31 09:35:29 +0100 <opqdonut> (monadic computations are those whose shape depends on runtime. applicative computations have a static structure.)
2022-10-31 09:35:54 +0100 <cheater> well i was thinking of something like sequencing getFooIO to get a lazy [Foo] in a pure context, and then passing that to a pure version of rec instead
2022-10-31 09:35:56 +0100Teacup(~teacup@user/teacup)
2022-10-31 09:36:19 +0100 <cheater> since getFooIO isn't actually taking any of its previous outputs
2022-10-31 09:36:23 +0100 <cheater> or any other stuff
2022-10-31 09:37:10 +0100 <opqdonut> you could rewrite rec using something like unfoldrM
2022-10-31 09:37:22 +0100 <opqdonut> but I think the explicit recursion here is nice
2022-10-31 09:38:17 +0100 <cheater> yeah i don't feel like using those crazy rare-case loop constructs
2022-10-31 09:38:30 +0100 <cheater> i just wonder if doing the lazy list thing would be a good idea
2022-10-31 09:38:42 +0100 <opqdonut> you can't make the [Foo] truly lazy without using some lazy IO constructs. sequence in IO is strict (as in, it runs all the IO ops before producing the head of the list)
2022-10-31 09:38:49 +0100 <opqdonut> lazy IO is usually a bad idea :)
2022-10-31 09:39:05 +0100 <cheater> hmmmmm
2022-10-31 09:39:13 +0100 <cheater> it's strict
2022-10-31 09:39:17 +0100 <cheater> right
2022-10-31 09:41:30 +0100talismanick(~talismani@76.133.152.122) (Ping timeout: 255 seconds)
2022-10-31 09:43:50 +0100freeside(~mengwong@bb115-66-48-84.singnet.com.sg)
2022-10-31 09:43:56 +0100schweers(~user@p200300e5773c9a00c23ebafffe9bd9c9.dip0.t-ipconnect.de) (Remote host closed the connection)
2022-10-31 09:43:58 +0100 <merijn> @hackage monad-loops
2022-10-31 09:43:58 +0100 <lambdabot> https://hackage.haskell.org/package/monad-loops
2022-10-31 09:44:17 +0100 <merijn> cheater: Anyway, why do you want to make it pure?
2022-10-31 09:44:40 +0100 <cheater> why not? just wondering if it's possible to restructure that way.
2022-10-31 09:44:49 +0100cheater(~Username@user/cheater) (BitchX by panasync)
2022-10-31 09:44:53 +0100cheater(~Username@user/cheater)
2022-10-31 09:44:55 +0100 <cheater> oops
2022-10-31 09:46:05 +0100 <merijn> cheater: Because attempting to remove IO from a place where it's kinda inherent is a great way to spend hours of time and end up with more brittle code ;)
2022-10-31 09:46:53 +0100 <cheater> there's no reason to believe it's inherent until you find out that there is no way to take io out
2022-10-31 09:48:17 +0100 <merijn> cheater: If the logic depends on the value produced by the IO, then it's always inherent and at best you can minimise the scope, but I think that's already mostly the case here
2022-10-31 09:48:35 +0100 <merijn> You could maybe clean it up a little bit via ExceptT to do the Either+IO at once
2022-10-31 09:48:51 +0100 <merijn> but depends on the rest of the code whether that's worth it
2022-10-31 09:48:53 +0100 <cheater> i don't feel like monad stacks
2022-10-31 09:49:06 +0100 <cheater> or rather transformer stacks
2022-10-31 09:49:16 +0100 <cheater> but it might be a good idea in other cases
2022-10-31 09:49:45 +0100 <tdammers> you could generalize it from IO to Monad m => m, because the Monad constraint really is all you depend on, it doesn't have to be IO
2022-10-31 09:51:01 +0100 <tdammers> (at least if the code is fixed the way I think it's intended to be fixed - as it is pasted, it won't compile)
2022-10-31 09:52:38 +0100thyriaen(~thyriaen@2a01:aea0:dd4:470d:6245:cbff:fe9f:48b1)
2022-10-31 09:52:55 +0100 <ski> if you parameterize over `sumAcc', you can make it more polymorphic
2022-10-31 09:58:40 +0100foul_owl(~kerry@174-21-75-230.tukw.qwest.net) (Ping timeout: 255 seconds)
2022-10-31 10:00:03 +0100sibnull[m](~sibnullma@2001:470:69fc:105::1:1291) (Quit: You have been kicked for being idle)
2022-10-31 10:00:56 +0100tromp(~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) (Quit: My iMac has gone to sleep. ZZZzzz…)
2022-10-31 10:01:23 +0100lortabac(~lortabac@2a01:e0a:541:b8f0:97e6:998a:289d:5f8e)
2022-10-31 10:01:44 +0100jakalx(~jakalx@base.jakalx.net) (Error from remote client)
2022-10-31 10:02:25 +0100kenran(~user@user/kenran)
2022-10-31 10:03:52 +0100kenran(~user@user/kenran) (Remote host closed the connection)
2022-10-31 10:03:59 +0100econo(uid147250@user/econo) (Quit: Connection closed for inactivity)
2022-10-31 10:05:57 +0100raehik(~raehik@cpc95906-rdng25-2-0-cust156.15-3.cable.virginm.net)
2022-10-31 10:07:26 +0100eggplantade(~Eggplanta@2600:1700:38c5:d800:7552:8274:e242:b93b)
2022-10-31 10:12:06 +0100eggplantade(~Eggplanta@2600:1700:38c5:d800:7552:8274:e242:b93b) (Ping timeout: 255 seconds)
2022-10-31 10:12:41 +0100fserucas|eod(~fserucas|@2001:818:e376:a400:fb92:70c1:dd88:c7d7)
2022-10-31 10:12:43 +0100foul_owl(~kerry@23.82.194.108)
2022-10-31 10:12:49 +0100freeside(~mengwong@bb115-66-48-84.singnet.com.sg) (Ping timeout: 252 seconds)
2022-10-31 10:13:24 +0100raehik(~raehik@cpc95906-rdng25-2-0-cust156.15-3.cable.virginm.net) (Ping timeout: 248 seconds)
2022-10-31 10:17:22 +0100fserucas|eod(~fserucas|@2001:818:e376:a400:fb92:70c1:dd88:c7d7) (Client Quit)
2022-10-31 10:19:05 +0100tzh_(~tzh@c-24-21-73-154.hsd1.wa.comcast.net) (Quit: zzz)
2022-10-31 10:26:01 +0100merijn(~merijn@86-86-29-250.fixed.kpn.net) (Ping timeout: 252 seconds)
2022-10-31 10:26:47 +0100merijn(~merijn@86-86-29-250.fixed.kpn.net)
2022-10-31 10:27:24 +0100CiaoSen(~Jura@p200300c9570c54002a3a4dfffe84dbd5.dip0.t-ipconnect.de) (Ping timeout: 255 seconds)
2022-10-31 10:28:10 +0100chele(~chele@user/chele)
2022-10-31 10:43:17 +0100echoone(~echoone@2a02:8109:a1c0:5d05:709d:fe7b:7272:b443)
2022-10-31 10:44:00 +0100TheCoffeMaker(~TheCoffeM@user/thecoffemaker) (Ping timeout: 250 seconds)
2022-10-31 10:44:15 +0100eaxli(~eax@user/eaxli)
2022-10-31 10:44:36 +0100__monty__(~toonn@user/toonn)
2022-10-31 10:46:57 +0100`2jt(~jtomas@191.red-88-17-199.dynamicip.rima-tde.net)
2022-10-31 10:47:42 +0100 <cheater> there's only one sumAcc that i'm interested in here
2022-10-31 10:47:48 +0100 <cheater> this polymorphism doesn't add anything here :)
2022-10-31 10:48:34 +0100jtomas(~jtomas@191.red-88-17-199.dynamicip.rima-tde.net) (Ping timeout: 252 seconds)
2022-10-31 10:48:45 +0100 <Hecate> richie sumAcc hahaha
2022-10-31 10:48:52 +0100 <Hecate> *rishi
2022-10-31 10:49:50 +0100TheCoffeMaker(~TheCoffeM@user/thecoffemaker)
2022-10-31 10:54:37 +0100machinedgod(~machinedg@d198-53-218-113.abhsia.telus.net) (Ping timeout: 252 seconds)
2022-10-31 10:56:28 +0100machinedgod(~machinedg@d198-53-218-113.abhsia.telus.net)
2022-10-31 10:57:08 +0100`2jt(~jtomas@191.red-88-17-199.dynamicip.rima-tde.net) (Quit: Leaving)
2022-10-31 11:01:09 +0100jakalx(~jakalx@base.jakalx.net)
2022-10-31 11:02:35 +0100takuan(~takuan@178-116-218-225.access.telenet.be)
2022-10-31 11:13:47 +0100eaxli(~eax@user/eaxli) (Quit: leaving)
2022-10-31 11:20:30 +0100 <ski> well, it'd give you parametricity, that your looping code doesn't mess with the accumulator, just from the types. but that might not be an issue for this particular piece of code, sure
2022-10-31 11:26:00 +0100Midjak2(~Midjak@82.66.147.146)
2022-10-31 11:27:32 +0100lucerne(~lucerne@5.113.197.120)
2022-10-31 11:27:50 +0100waleee(~waleee@2001:9b0:213:7200:cc36:a556:b1e8:b340)
2022-10-31 11:28:10 +0100Midjak(~Midjak@82.66.147.146) (Ping timeout: 252 seconds)
2022-10-31 11:30:06 +0100cyphase(~cyphase@user/cyphase) (Ping timeout: 260 seconds)
2022-10-31 11:35:13 +0100cyphase(~cyphase@user/cyphase)
2022-10-31 11:39:43 +0100Teacup(~teacup@user/teacup) (Ping timeout: 252 seconds)
2022-10-31 11:40:13 +0100Teacup(~teacup@user/teacup)
2022-10-31 11:46:17 +0100vglfr(~vglfr@145.224.100.22) (Read error: Connection reset by peer)
2022-10-31 11:46:31 +0100vglfr(~vglfr@145.224.100.22)
2022-10-31 12:00:25 +0100sweater1(~sweater@206.81.18.26) (Quit: WeeChat 2.8)
2022-10-31 12:04:13 +0100tromp(~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl)
2022-10-31 12:04:17 +0100sa(sid1055@id-1055.tinside.irccloud.com) (Ping timeout: 240 seconds)
2022-10-31 12:04:36 +0100jackdk(sid373013@cssa/jackdk) (Ping timeout: 255 seconds)
2022-10-31 12:04:58 +0100hongminhee(sid295@id-295.tinside.irccloud.com) (Ping timeout: 246 seconds)
2022-10-31 12:04:59 +0100polo(sid532813@user/polo) (Ping timeout: 276 seconds)
2022-10-31 12:05:02 +0100kristjansson(sid126207@id-126207.tinside.irccloud.com) (Ping timeout: 250 seconds)
2022-10-31 12:05:07 +0100jmct(sid160793@id-160793.tinside.irccloud.com) (Ping timeout: 246 seconds)
2022-10-31 12:05:32 +0100freeside(~mengwong@bb115-66-48-84.singnet.com.sg)
2022-10-31 12:06:14 +0100hongminhee(sid295@id-295.tinside.irccloud.com)
2022-10-31 12:06:15 +0100jmct(sid160793@id-160793.tinside.irccloud.com)
2022-10-31 12:06:37 +0100polo(sid532813@user/polo)
2022-10-31 12:06:41 +0100jackdk(sid373013@cssa/jackdk)
2022-10-31 12:06:51 +0100sa(sid1055@2a03:5180:f::41f)
2022-10-31 12:07:31 +0100kristjansson(sid126207@2a03:5180:f::1:ecff)
2022-10-31 12:08:54 +0100zer0bitz_(~zer0bitz@196.244.192.57)
2022-10-31 12:10:12 +0100freeside(~mengwong@bb115-66-48-84.singnet.com.sg) (Ping timeout: 248 seconds)
2022-10-31 12:12:41 +0100zer0bitz(~zer0bitz@2001:2003:f748:2000:5894:8e10:5893:ce6f) (Ping timeout: 260 seconds)
2022-10-31 12:14:28 +0100jinsun(~jinsun@user/jinsun) (Ping timeout: 248 seconds)
2022-10-31 12:14:55 +0100foul_owl(~kerry@23.82.194.108) (Ping timeout: 252 seconds)
2022-10-31 12:16:02 +0100bw_(sid2730@id-2730.ilkley.irccloud.com) ()
2022-10-31 12:17:03 +0100bw_(sid2730@user/betawaffle)
2022-10-31 12:18:08 +0100bw_bw
2022-10-31 12:19:05 +0100jinsun(~jinsun@user/jinsun)
2022-10-31 12:25:33 +0100coot(~coot@2a02:a310:e241:1b00:ec1a:e9df:79ac:66ba) (Quit: coot)
2022-10-31 12:28:07 +0100beteigeuze(~Thunderbi@bl14-81-220.dsl.telepac.pt)
2022-10-31 12:28:07 +0100comerijn(~merijn@86-86-29-250.fixed.kpn.net)
2022-10-31 12:28:31 +0100foul_owl(~kerry@23.82.194.108)
2022-10-31 12:30:52 +0100merijn(~merijn@86-86-29-250.fixed.kpn.net) (Ping timeout: 252 seconds)
2022-10-31 12:31:13 +0100o-90(~o-90@gateway/tor-sasl/o-90)
2022-10-31 12:32:59 +0100o-90(~o-90@gateway/tor-sasl/o-90) (Client Quit)
2022-10-31 12:35:35 +0100comerijnmerijn
2022-10-31 12:43:59 +0100acidjnk(~acidjnk@p200300d6e7137a70ac64450b6466d6c8.dip0.t-ipconnect.de) (Ping timeout: 276 seconds)
2022-10-31 12:46:41 +0100pie_(~pie_bnc@user/pie/x-2818909) ()
2022-10-31 12:47:05 +0100pie_(~pie_bnc@user/pie/x-2818909)
2022-10-31 12:49:36 +0100vglfr(~vglfr@145.224.100.22) (Ping timeout: 255 seconds)
2022-10-31 12:50:29 +0100vglfr(~vglfr@145.224.100.22)
2022-10-31 12:59:14 +0100frost5(~frost@user/frost)
2022-10-31 13:15:46 +0100coot(~coot@2a02:a310:e241:1b00:ec1a:e9df:79ac:66ba)
2022-10-31 13:18:34 +0100eL_Bart0(eL_Bart0@dietunichtguten.org)
2022-10-31 13:21:08 +0100arahael(~arahael@14-200-56-241.tpgi.com.au) (Ping timeout: 248 seconds)
2022-10-31 13:22:25 +0100freeside(~mengwong@bb115-66-48-84.singnet.com.sg)
2022-10-31 13:30:35 +0100bitdex(~bitdex@gateway/tor-sasl/bitdex) (Quit: = "")
2022-10-31 13:33:57 +0100arahael(~arahael@124.168.94.52)
2022-10-31 13:34:10 +0100irrgit(~irrgit@176.113.74.74)
2022-10-31 13:36:19 +0100freeside(~mengwong@bb115-66-48-84.singnet.com.sg) (Ping timeout: 252 seconds)
2022-10-31 13:38:36 +0100irrgit_(~irrgit@176.113.74.74)
2022-10-31 13:41:49 +0100irrgit(~irrgit@176.113.74.74) (Ping timeout: 252 seconds)
2022-10-31 13:44:19 +0100mcglk(~mcglk@131.191.49.120) (Quit: (seeya))
2022-10-31 13:44:57 +0100jmdaemon(~jmdaemon@user/jmdaemon) (Ping timeout: 255 seconds)
2022-10-31 13:50:19 +0100king_gs(~Thunderbi@2806:103e:29:47b9:f34b:ffff:4cfc:90a6)
2022-10-31 13:52:54 +0100polomoney
2022-10-31 13:57:35 +0100 <yin> if i want a data type with 8 values (Word3) what's the best way to represent it for efficiency? data A = A0 | A1 | A2 | A3 | A4 | A5 | A6 | A7 or just type A = Word ?
2022-10-31 13:57:52 +0100 <merijn> Define efficiency
2022-10-31 13:59:31 +0100 <yin> a simulation with billion "atoms" that each can be in one of 8 states. speed is prioritized over space efficiency
2022-10-31 14:00:02 +0100 <yin> lots of updates
2022-10-31 14:00:03 +0100 <merijn> yin: tbh, you'd probably want some kinda packed array representation then
2022-10-31 14:00:10 +0100 <merijn> and/or SIMD accommodating stuf
2022-10-31 14:00:27 +0100 <yin> what is SIMD?
2022-10-31 14:01:21 +0100 <merijn> https://en.wikipedia.org/wiki/Single_instruction,_multiple_data
2022-10-31 14:02:01 +0100 <yin> oh i know what that is :)
2022-10-31 14:02:52 +0100 <yin> i don't need that much
2022-10-31 14:03:45 +0100 <yin> forget billion, let's say hundreds
2022-10-31 14:04:32 +0100 <yin> between those 2 choices or something similar, what should i be expecting?
2022-10-31 14:04:53 +0100shriekingnoise(~shrieking@186.137.167.202) (Quit: Quit)
2022-10-31 14:07:36 +0100frost5(~frost@user/frost) (Ping timeout: 244 seconds)
2022-10-31 14:08:13 +0100tromp(~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) (Ping timeout: 252 seconds)
2022-10-31 14:09:13 +0100mcglk(~mcglk@131.191.49.120)
2022-10-31 14:09:14 +0100zer0bitz(~zer0bitz@196.244.192.57)
2022-10-31 14:09:23 +0100 <Axman6> yin: try both and benchmark
2022-10-31 14:12:37 +0100zer0bitz_(~zer0bitz@196.244.192.57) (Ping timeout: 252 seconds)
2022-10-31 14:15:30 +0100 <probie> If you can afford the RAM, why not experiment with a one-hot encoding? newtype A = A Word8; pattern A0 = A 1; pattern A1 = A 2; pattern A2 = A 4; ... pattern A7 = A 128
2022-10-31 14:17:19 +0100 <Axman6> yeh anpther good idea - makes -acking them into an unboxed vector trivial
2022-10-31 14:17:39 +0100Guest811(~Guest811@185.134.101.4)
2022-10-31 14:17:44 +0100raehik(~raehik@cpc95906-rdng25-2-0-cust156.15-3.cable.virginm.net)
2022-10-31 14:17:53 +0100vglfr(~vglfr@145.224.100.22) (Remote host closed the connection)
2022-10-31 14:18:28 +0100vglfr(~vglfr@145.224.100.22)
2022-10-31 14:21:05 +0100 <Axman6> Hecate: well, I laughed at the Rishi Sunak joke XD
2022-10-31 14:21:59 +0100vglfr(~vglfr@145.224.100.22) (Remote host closed the connection)
2022-10-31 14:22:17 +0100vglfr(~vglfr@145.224.100.22)
2022-10-31 14:24:06 +0100raehik(~raehik@cpc95906-rdng25-2-0-cust156.15-3.cable.virginm.net) (Ping timeout: 255 seconds)
2022-10-31 14:25:15 +0100irrgit__(~irrgit@146.70.27.218)
2022-10-31 14:26:26 +0100vglfr(~vglfr@145.224.100.22) (Remote host closed the connection)
2022-10-31 14:27:00 +0100raehik(~raehik@cpc95906-rdng25-2-0-cust156.15-3.cable.virginm.net)
2022-10-31 14:27:22 +0100vglfr(~vglfr@145.224.100.22)
2022-10-31 14:27:28 +0100irrgit_(~irrgit@176.113.74.74) (Ping timeout: 252 seconds)
2022-10-31 14:29:09 +0100vglfr(~vglfr@145.224.100.22) (Remote host closed the connection)
2022-10-31 14:29:42 +0100vglfr(~vglfr@145.224.100.22)
2022-10-31 14:30:05 +0100irrgit_(~irrgit@176.113.74.130)
2022-10-31 14:30:13 +0100beteigeuze(~Thunderbi@bl14-81-220.dsl.telepac.pt) (Ping timeout: 252 seconds)
2022-10-31 14:30:22 +0100vglfr(~vglfr@145.224.100.22) (Remote host closed the connection)
2022-10-31 14:30:32 +0100beteigeuze(~Thunderbi@bl14-81-220.dsl.telepac.pt)
2022-10-31 14:31:55 +0100vglfr(~vglfr@145.224.100.22)
2022-10-31 14:32:25 +0100irrgit__(~irrgit@146.70.27.218) (Ping timeout: 252 seconds)
2022-10-31 14:32:26 +0100ystael(~ystael@user/ystael)
2022-10-31 14:33:40 +0100shapr(~user@68.54.166.125) (Ping timeout: 248 seconds)
2022-10-31 14:34:23 +0100raehik(~raehik@cpc95906-rdng25-2-0-cust156.15-3.cable.virginm.net) (Ping timeout: 246 seconds)
2022-10-31 14:34:29 +0100vglfr(~vglfr@145.224.100.22) (Remote host closed the connection)
2022-10-31 14:35:52 +0100vglfr(~vglfr@145.224.100.22)
2022-10-31 14:36:53 +0100Guest811(~Guest811@185.134.101.4) (Quit: Client closed)
2022-10-31 14:39:19 +0100 <Hecate> Axman6: :D
2022-10-31 14:41:31 +0100KaipeiKaiepi
2022-10-31 14:45:42 +0100acidjnk(~acidjnk@p200300d6e7137a36f0ab6f680c2cefbd.dip0.t-ipconnect.de)
2022-10-31 14:47:03 +0100 <kaol> Why's there no Contravariant instance for (->)?
2022-10-31 14:47:51 +0100 <merijn> kaol: The types don't line up
2022-10-31 14:48:06 +0100 <merijn> kaol: The contravariant instance would be on the first argument to (->), not the second
2022-10-31 14:48:56 +0100 <kaol> I thought it'd be something like that.
2022-10-31 14:48:57 +0100tromp(~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl)
2022-10-31 14:49:08 +0100 <merijn> You can write "instance Functor ((->) a) where" but there's no way to write, like, "instance Contravariant (Flip (->) a)" or "instance Contravariant ((->) ? a)"
2022-10-31 14:49:18 +0100seydar(~seydar@154-27-113-252.starry-inc.net)
2022-10-31 14:49:29 +0100 <merijn> It requires type level lambdas to do that, which is a whole other can of worms
2022-10-31 14:50:07 +0100 <merijn> You could write "newtype FlipFun b a = FlipFun (a -> b)" instance Contravariant (FlipFun r)" though
2022-10-31 14:50:37 +0100shapr(~user@68.54.166.125)
2022-10-31 14:50:56 +0100 <kaol> Reminds me of TypeApplications somewhat. They can do stuff like "f @_ @Int".
2022-10-31 14:51:22 +0100 <merijn> kaol: More usefully, Profunctor includes both options for (->)
2022-10-31 14:51:25 +0100 <seydar> is there a better way to store GPS coordinates so that I can do a faster distance calculation?
2022-10-31 14:51:37 +0100Teacup_(~teacup@user/teacup)
2022-10-31 14:52:25 +0100 <kaol> Yeah, no big loss of anything if I use it as profunctor instead. I was just wondering about it.
2022-10-31 14:53:19 +0100irrgit_(~irrgit@176.113.74.130) (Ping timeout: 252 seconds)
2022-10-31 14:53:27 +0100Sgeo(~Sgeo@user/sgeo)
2022-10-31 14:54:12 +0100Teacup(~teacup@user/teacup) (Quit: No Ping reply in 180 seconds.)
2022-10-31 14:54:35 +0100Teacup_(~teacup@user/teacup) (Read error: Connection reset by peer)
2022-10-31 14:55:31 +0100Teacup(~teacup@user/teacup)
2022-10-31 15:00:23 +0100freeside(~mengwong@bb115-66-48-84.singnet.com.sg)
2022-10-31 15:01:39 +0100Guest75(~Guest75@178.141.197.193)
2022-10-31 15:02:09 +0100 <Guest75> Hello! I'm learning and trying to compose a function that break string on certain character:
2022-10-31 15:02:19 +0100 <Guest75> myBreak "" _ = []
2022-10-31 15:02:19 +0100 <Guest75> myBreak x c = (takeWhile (/= c) x):myBreak(drop 1 (dropWhile (/= c) x))
2022-10-31 15:02:50 +0100 <Guest75> when I've had one parameter and '\n' instead of c in (/= c) it worked fine, and like this I'm getting type error
2022-10-31 15:03:30 +0100 <c_wraith> what's your desired type?
2022-10-31 15:03:43 +0100 <Guest75> myBreak Char -> String -> [String]
2022-10-31 15:05:15 +0100 <Guest75> myBreak '\n' "apple\nbanana\norange"
2022-10-31 15:05:53 +0100 <probie> myBreak takes two arguments, yet in myBreak(drop 1 (dropWhile (/= c) x)) you're only giving it one argument
2022-10-31 15:06:19 +0100 <kaol> seydar: I'm going to say store in PosgreSQL and use PostGIS.
2022-10-31 15:06:31 +0100 <c_wraith> I'm surprised the error message didn't say you probably meant to pass it another argument
2022-10-31 15:07:10 +0100 <Guest75> probie thanks! really didn't see that :D
2022-10-31 15:07:43 +0100 <Guest75> c_wraith it's like that: https://paste.tomsmeding.com/gYuCJmfO
2022-10-31 15:08:34 +0100 <Guest75> I've used too much to overwhelming error messages, so will take some time to get acquainted with useful ones
2022-10-31 15:08:57 +0100 <probie> The other problem is that the you've got the two arguments backwards. Your provided type is Char -> String -> [String], but what you've written is a function String -> Char -> [String]
2022-10-31 15:09:53 +0100 <probie> In your example "c" (the character you break on) is the first argument. In the definition of myBreak you've given, it's the second argument
2022-10-31 15:11:37 +0100 <Guest75> probie yes, thanks. I fixed all errors now
2022-10-31 15:11:37 +0100 <seydar> kaol: thanks!
2022-10-31 15:11:59 +0100eggplantade(~Eggplanta@2600:1700:38c5:d800:7552:8274:e242:b93b)
2022-10-31 15:12:44 +0100seydar(~seydar@154-27-113-252.starry-inc.net) (Quit: leaving)
2022-10-31 15:13:28 +0100 <Guest75> I actually think I'll be leaving most of the work to Haskell. i.e. instead of writing type signatues I'll write a function (if I understand it well) and then type :t <my function> to check etc
2022-10-31 15:14:08 +0100 <geekosaur> that's actually something of a bad idea. the compiler will produce much more helpful error nmessages if you declare all the expected types up front
2022-10-31 15:15:50 +0100 <Guest75> Will that be true still if dealing with more "relaistic" and complex tasks like e.g. using Aeson module, fns from Foldable/Traversable/Witherable etc typeclasses and other stuff?
2022-10-31 15:16:18 +0100eggplantade(~Eggplanta@2600:1700:38c5:d800:7552:8274:e242:b93b) (Ping timeout: 255 seconds)
2022-10-31 15:18:12 +0100 <c_wraith> When type classes get involved, it becomes a lot more valuable.
2022-10-31 15:18:41 +0100raehik(~raehik@cpc95906-rdng25-2-0-cust156.15-3.cable.virginm.net)
2022-10-31 15:19:08 +0100 <Guest75> aha
2022-10-31 15:19:51 +0100 <geekosaur> the compiler will tend to make weird "assumptions" to try to make code typecheck unless you use a type signature to steer it in the correct direction
2022-10-31 15:20:06 +0100 <geekosaur> (sorry, p0hone call)
2022-10-31 15:20:14 +0100 <Guest75> had a look at this yesterday: https://paste.tomsmeding.com/KOJdzuvW
2022-10-31 15:21:24 +0100zebrag(~chris@user/zebrag)
2022-10-31 15:21:42 +0100 <Guest75> I agree that's still readable
2022-10-31 15:21:46 +0100echoone(~echoone@2a02:8109:a1c0:5d05:709d:fe7b:7272:b443) (Quit: Client closed)
2022-10-31 15:23:38 +0100 <Guest75> My actual goal with Haskell now it so process/analyse Python code (which I converted to JSON in good time)
2022-10-31 15:24:18 +0100 <merijn> Wait...why did you convert python to JSON to analyse *that*? :o
2022-10-31 15:24:33 +0100 <Guest75> @merij
2022-10-31 15:24:33 +0100 <lambdabot> Unknown command, try @list
2022-10-31 15:26:15 +0100 <Guest75> merijn: there's this Python module: https://github.com/Instagram/LibCST which parses Python code into set of nested nodes (subclasses of CSTNode). CSTNode is a dataclass (i.e. just merely like a record that has a name as in Haskell)
2022-10-31 15:27:38 +0100 <merijn> Guest75: What kinda processing/analysis are you trying to do?
2022-10-31 15:28:36 +0100 <Guest75> so for that dataclasses I've created a couple of procedures: https://dpaste.com/BFL46EM46 whcih convert to and from JSON (notice type/typeparam name clash LOL)
2022-10-31 15:29:59 +0100FinnElija(~finn_elij@user/finn-elija/x-0085643) (Remote host closed the connection)
2022-10-31 15:30:04 +0100 <Guest75> merijn I usually code Python (and JavaScript) for food (kinda). In a project I work on is a lot of copy and paste code that's hard to maintain. I first come up with this tool to speed up the process: https://github.com/andrewboltachev/mega-copy
2022-10-31 15:30:23 +0100king_gs(~Thunderbi@2806:103e:29:47b9:f34b:ffff:4cfc:90a6) (Ping timeout: 276 seconds)
2022-10-31 15:30:27 +0100 <Guest75> (ah unfortunantly README disappeared)
2022-10-31 15:30:33 +0100FinnElija(~finn_elij@user/finn-elija/x-0085643)
2022-10-31 15:31:19 +0100tromp(~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) (Quit: My iMac has gone to sleep. ZZZzzz…)
2022-10-31 15:35:12 +0100 <Guest75> https://dpaste.com/5B6L2K97P like this really :/
2022-10-31 15:37:20 +0100arahael(~arahael@124.168.94.52) (Ping timeout: 252 seconds)
2022-10-31 15:39:56 +0100 <Guest75> merijn so in fact I want to create sth like subset of Python: https://dpaste.com/7X8VCYP2G which will help to find "patterns" of code first
2022-10-31 15:40:49 +0100 <merijn> I mean, you're effectively trying to create a compiler/DSL :)
2022-10-31 15:41:18 +0100 <merijn> Which is generally easier to do when you actually approach things as a compiler/DSL problem
2022-10-31 15:41:44 +0100 <Guest75> The thing is that the code above is 100% syntactically correct. I don't need to parse it. I just need to interpret
2022-10-31 15:42:18 +0100 <merijn> Do I have some bad news for you :)
2022-10-31 15:42:26 +0100 <Guest75> please?
2022-10-31 15:42:43 +0100 <merijn> That you WILL have to parse it
2022-10-31 15:43:04 +0100 <merijn> The only question is whether you're parsing it from the JSON format you mentioned earlier or just Python directly
2022-10-31 15:43:47 +0100 <merijn> You need structured data to implement an interpreter and going from unstructured JSON (or python source) to a structured representation *is* parsing
2022-10-31 15:44:37 +0100 <Guest75> JSON for the above is like that currently: https://dpaste.com/3A6B3MW5X
2022-10-31 15:45:05 +0100nckhexenjeffbezos
2022-10-31 15:45:32 +0100 <Guest75> Python directly is scary to me yet :-)
2022-10-31 15:45:36 +0100phma(~phma@2001:5b0:211f:2dc8:ca7e:3ef3:1458:a7b3) (Read error: Connection reset by peer)
2022-10-31 15:46:19 +0100 <merijn> Guest75: You will probably still want to define your AST type to work with. Whether you construct that AST from JSON or python source isn't *that* important
2022-10-31 15:46:47 +0100 <merijn> But working with an actual AST will make your life considerably easier than working with a mess of JSON
2022-10-31 15:47:13 +0100 <Guest75> But this JSON *is* and AST. It's even a CST (generated by LibCST)
2022-10-31 15:47:18 +0100 <Guest75> *an AST
2022-10-31 15:48:06 +0100tromp(~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl)
2022-10-31 15:48:18 +0100phma(~phma@2001:5b0:2172:ba88:9bea:3e0e:39f6:5a74)
2022-10-31 15:49:18 +0100 <ski> the point of using a dedicated AST datatype is to rule out (some) invalid representations. if you're using a generic JSON format, chances are most of the allowed inputs are syntactically invalid
2022-10-31 15:49:31 +0100 <ski> (well, part of the point, anyway)
2022-10-31 15:50:27 +0100 <Guest75> ski yes I've been thinking to generate a datatype like... data PyCSTNode = SimpleWhitespace { value :: String } | Expr { value :: CSTNode ...} ...
2022-10-31 15:50:31 +0100 <yin> use GADTs to make illegal states unrepresentable!
2022-10-31 15:50:40 +0100arahael(~arahael@124.168.94.52)
2022-10-31 15:50:41 +0100 <yin> (am i doing this right?)
2022-10-31 15:50:49 +0100 <Guest75> but want to do that more or less automatically :-)
2022-10-31 15:51:01 +0100motherfsck(~motherfsc@user/motherfsck)
2022-10-31 15:51:21 +0100 <ski> you're representing whitespace ?
2022-10-31 15:51:24 +0100chomwitt(~chomwitt@2a02:587:dc18:4a00:1ac0:4dff:fedb:a3f1) (Ping timeout: 246 seconds)
2022-10-31 15:52:01 +0100 <Guest75> ski that's part of LibCST format ("concete" syntax tree, not "abstract"). In fact LibCST has very clever approach to Whitespace
2022-10-31 15:52:07 +0100 <ski> are you sure you're not doing a parse tree, a *concrete* syntax tree, rather than an *abstract* syntax tree ?
2022-10-31 15:52:18 +0100 <ski> mhm
2022-10-31 15:52:39 +0100 <Guest75> "clever" in a way that if you generate it from scratch
2022-10-31 15:52:59 +0100 <Guest75> it auto-adds useful defaults
2022-10-31 15:53:26 +0100 <Guest75> and yes the end goal is to write python back to files
2022-10-31 15:53:28 +0100 <ski> yin : .. maybe, maybe not ?
2022-10-31 15:54:26 +0100jakalx(~jakalx@base.jakalx.net) (Error from remote client)
2022-10-31 15:55:09 +0100shapr(~user@68.54.166.125) (Remote host closed the connection)
2022-10-31 15:55:35 +0100yinshrugs
2022-10-31 15:56:05 +0100 <Guest75> yin yes I will love to see anything algebraic :-)
2022-10-31 15:56:45 +0100 <Guest75> I wonder why this isn't popular in other languages. e.g. "reduce" function is really something that works on Monoid
2022-10-31 15:56:48 +0100phma(~phma@2001:5b0:2172:ba88:9bea:3e0e:39f6:5a74) (Read error: Connection reset by peer)
2022-10-31 15:57:05 +0100sadmax(~user@209.205.174.253)
2022-10-31 15:57:09 +0100 <ski> hm, well. sometimes "AST" means "Abstract Syntax Tree". but sometimes (more in a Haskell context) "AST" can also mean "Algebraic Data Type"
2022-10-31 15:57:21 +0100jakalx(~jakalx@base.jakalx.net)
2022-10-31 15:57:38 +0100 <Guest75> aha
2022-10-31 15:58:52 +0100 <Guest75> One Clojure developer I talked to said that "Trying to find Monads and other patterns in code is more like trying to find birds in tree"
2022-10-31 15:59:53 +0100 <geekosaur> huh? isn;t that ADT?
2022-10-31 16:00:05 +0100 <Guest75> but I think I'm yet to discover algebraic types' usability
2022-10-31 16:00:14 +0100 <ski> er .. sorry, brainfart
2022-10-31 16:00:23 +0100 <geekosaur> although I think ADT has its own dual meaning
2022-10-31 16:00:32 +0100 <ski> i was thinking of "Abstract Data Type" versus "Algebraic Data Type"
2022-10-31 16:01:16 +0100 <geekosaur> right, that
2022-10-31 16:01:32 +0100 <merijn> Guest75: Fairly straightforward? :p
2022-10-31 16:01:45 +0100 <merijn> Finding birds in trees isn't particularly challenging
2022-10-31 16:01:54 +0100 <ski> Guest75 : "reduce" in which sense ?
2022-10-31 16:02:33 +0100 <geekosaur> depends. I could hear a catbird in a nearby tree but couldn't spot it for the life of me this morning
2022-10-31 16:03:00 +0100 <Guest75> @ski: reduce e.g. collapse a list to a value. is it called foldl/foldr? Us who doesn't know about moniods (not me) can say: "reduce" has 0 element and binary operation
2022-10-31 16:03:00 +0100 <lambdabot> Unknown command, try @list
2022-10-31 16:03:04 +0100 <Guest75> ski: reduce e.g. collapse a list to a value. is it called foldl/foldr? Us who doesn't know about moniods (not me) can say: "reduce" has 0 element and binary operation
2022-10-31 16:03:39 +0100 <Guest75> @merijn : I thought he said that it's funny but not useful
2022-10-31 16:03:39 +0100 <lambdabot> Unknown command, try @list
2022-10-31 16:03:40 +0100 <yin> finding birds in trees is trivial but finding birds in trees in a specific order can be challanging
2022-10-31 16:03:43 +0100 <Guest75> merijn : I thought he said that it's funny but not useful
2022-10-31 16:04:13 +0100 <geekosaur> huh? patterns are very useful. patterns are how we think
2022-10-31 16:04:54 +0100lortabac(~lortabac@2a01:e0a:541:b8f0:97e6:998a:289d:5f8e) (Ping timeout: 255 seconds)
2022-10-31 16:04:56 +0100ddellacosta(~ddellacos@143.244.47.76)
2022-10-31 16:05:43 +0100 <Guest75> I think Clojure tend to simplify things (to just plain data mostly), and found out monads and other structures are complex
2022-10-31 16:06:18 +0100 <Guest75> Creator of Clojure Rich Hickey gave this talk, naming it after Maybe in Haskell: https://www.youtube.com/watch?v=YR5WdGrpoug
2022-10-31 16:07:27 +0100 <probie> Guest75: don't tag people with an "@" - it's not idiomatic on IRC (and it confuses lambdabot)
2022-10-31 16:07:44 +0100 <Guest75> aha ty probie
2022-10-31 16:08:49 +0100 <merijn> tbh, I kinda liked Rich Hickey's philosophy (it's not for me, but has at least some internal consistency), but he's very dismissive about things like Haskell without, imho, demonstrating that he actually understands them well enough to have an opinion on it
2022-10-31 16:09:03 +0100 <ski> Guest75 : well, "fold" can have two distinct meanings (in this context). (a) combine a sequence of "elements" into a single result -- this combination could be monoidal (`fold',`foldMap'), or it could be left- or right- associated (`foldl',`foldr'); or (b) replace the constructors of a (usually recursive) data type with provided callback functions, "crushing/smashing" the structure down to a single result
2022-10-31 16:09:35 +0100 <ski> Guest75 : for (single-linked, right-associated) lists, `foldr' happens to be both (a) and (b). but in general, these are distinct things
2022-10-31 16:09:38 +0100zer0bitz_(~zer0bitz@196.244.192.57)
2022-10-31 16:10:26 +0100 <chromoblob> :t (\(const x -> y) x -> y)
2022-10-31 16:10:27 +0100 <lambdabot> b -> p -> Expr
2022-10-31 16:10:43 +0100 <Guest75> merjin: for me the saddest thing is that Clojure as a result (or however else) still doesn't have decent typing system. https://github.com/clojure/core.typed this one just failed. and clojure.spec is a runtime mechanism
2022-10-31 16:10:58 +0100 <chromoblob> interesting, how does the view pattern access variables that happen on right of it?
2022-10-31 16:11:21 +0100 <chromoblob> it's not a straightforward transformation to cases any more
2022-10-31 16:11:43 +0100 <ski> ime, `reduce' is often used where the neutral element is only used when there's zero elements. while `foldl' and `foldr' will use the "initial state" / "bottom recursive result" (which need not be a neutral element in a monoid) in every case
2022-10-31 16:11:56 +0100 <jean-paul[m]> is there a simple API to get the current time as a POSIX timestamp as an integer? :/ There's so many ways to get other kinds of time or POSIX timestamps as other types but I can't find this one.
2022-10-31 16:12:23 +0100 <ski> chromoblob : it doesn't
2022-10-31 16:12:31 +0100 <ski> that uses `x :: Expr' from `simplereflect'
2022-10-31 16:12:44 +0100 <ski> @type x
2022-10-31 16:12:45 +0100 <lambdabot> Expr
2022-10-31 16:12:48 +0100 <ski> > x^5
2022-10-31 16:12:50 +0100 <lambdabot> x * x * (x * x) * x
2022-10-31 16:13:04 +0100 <chromoblob> :t (\(const lala -> y) lala -> y)
2022-10-31 16:13:04 +0100zer0bitz(~zer0bitz@196.244.192.57) (Ping timeout: 252 seconds)
2022-10-31 16:13:05 +0100 <lambdabot> error:
2022-10-31 16:13:05 +0100 <lambdabot> • Variable not in scope: lala
2022-10-31 16:13:05 +0100 <lambdabot> • Perhaps you meant ‘ala’ (imported from Control.Lens)
2022-10-31 16:13:09 +0100 <Guest75> ski : thanks, I expect to be more complicated meanings of it there. AFAIK all "reduces" I worked with do use neutral element if it's given
2022-10-31 16:13:11 +0100 <chromoblob> ah, okay
2022-10-31 16:14:00 +0100 <ski> Guest75 : yea, often it's used as a synonym for `foldl'/`fold-left'
2022-10-31 16:14:01 +0100 <chromoblob> but could it in principle do that
2022-10-31 16:14:17 +0100 <chromoblob> via letrecs somehow
2022-10-31 16:14:59 +0100phma(phma@2001:5b0:210d:ac28:95ba:8163:b584:2813)
2022-10-31 16:15:23 +0100 <ski> @type let map _ [] = []; map f ((f -> y):(map f -> ys)) = y:ys in map
2022-10-31 16:15:24 +0100 <lambdabot> (t -> a) -> [t] -> [a]
2022-10-31 16:15:53 +0100 <ski> @type \x x -> x
2022-10-31 16:15:54 +0100 <lambdabot> error:
2022-10-31 16:15:54 +0100 <lambdabot> • Conflicting definitions for ‘x’
2022-10-31 16:15:54 +0100 <lambdabot> Bound at: <interactive>:1:2
2022-10-31 16:16:21 +0100 <ski> given ^, it would make sense for `\(const x -> y) x -> y' to work as you wanted, imho
2022-10-31 16:17:59 +0100 <ski> (but perhaps this is because of matching patterns from left to right, hm)
2022-10-31 16:18:37 +0100 <Guest75>  geekosaur : do you guys use more "advanced" constructs from CT in Haskell such as Limits/Co-limits?
2022-10-31 16:19:13 +0100 <ski> we don't tend to talk about limits and colimits much, really
2022-10-31 16:19:15 +0100 <Guest75> (talking directly from B. Milewski's book :-)  )
2022-10-31 16:19:49 +0100 <Guest75> so in practice that's a bit "overhyped"?
2022-10-31 16:20:28 +0100 <ski> it can be fun to know about, if you enjoy math. but it's not essential to use Haskell, no
2022-10-31 16:20:48 +0100 <Guest75> I only understood what a Monad is in Haskell about 2 weeks ago, and I wonder if other things will bring much use or not
2022-10-31 16:21:24 +0100 <ski> occasionally, such a CT concept may be relevant, to some degree. and occasionally, it can be nice to be able to recognize/spot a categorical pattern, in code or interfaces (and possibly even be able to exploit the pattern for some good)
2022-10-31 16:21:51 +0100 <geekosaur> that said, I'm a sysadmin, not a mathy type, and I get by without all the advanced math
2022-10-31 16:21:59 +0100 <geekosaur> even maintain a couple Haskell packages
2022-10-31 16:22:14 +0100python476(~user@88.160.31.174)
2022-10-31 16:22:17 +0100 <merijn> Guest75: You can see how useful abstractions are by how quickly they took over Haskell :p
2022-10-31 16:22:28 +0100pie_(~pie_bnc@user/pie/x-2818909) (Ping timeout: 248 seconds)
2022-10-31 16:22:29 +0100 <ski> e.g. (not quite the same thing, since it's just abstract algebra, not category theory(, but in the two videos where kmett talks about monoidal parsing, he talks about the pattern of semi-direct product popping up several times in practical programming
2022-10-31 16:22:46 +0100 <merijn> Guest75: Monadic IO wasn't in the first 3 (4?) versions of Haskell, but when it was added took over everything instantly
2022-10-31 16:23:08 +0100 <Guest75> geekosaur: aha, ty! I recall someone told me about a Haskell package for custom keyboard control (i.e. hardware)
2022-10-31 16:23:11 +0100 <merijn> Guest75: Similarly, Applicative wasn't discovered until, like, 2004 and was *everywhere* in the Haskell ecosystem within 3 years
2022-10-31 16:23:24 +0100 <geekosaur> merijn, even that can be misleading though. Monad got in not because it wasCT but because it provided something a whole lot more reliable than `main :: [Response] -> [Request]`
2022-10-31 16:23:30 +0100 <merijn> Meanwhile, Arrows language in obscurity
2022-10-31 16:23:32 +0100 <Guest75> https://math.mit.edu/~dspivak/informatics/talks/galois.pdf this is one idea that took over me at least :-)
2022-10-31 16:23:42 +0100 <geekosaur> Guest75, kmonad?
2022-10-31 16:23:51 +0100darkstardevx(~darkstard@50.126.124.156) (Read error: Connection reset by peer)
2022-10-31 16:23:55 +0100 <ski> the biggest problem with `Arrow' is probably `arr'
2022-10-31 16:24:18 +0100 <Guest75> geekosaur : yes, must be!
2022-10-31 16:25:10 +0100vglfr(~vglfr@145.224.100.22) (Ping timeout: 252 seconds)
2022-10-31 16:26:03 +0100tromp(~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) (Read error: Connection reset by peer)
2022-10-31 16:26:43 +0100 <ski> geekosaur : yes. even making `newtype Answer = MkAnswer ([Response] -> [Request])' an abstract data type, and coding in CPS (effectively `Cont Answer', without the monadic abstraction) would have gone quite some way towards more reliability
2022-10-31 16:26:44 +0100pie_(~pie_bnc@user/pie/x-2818909)
2022-10-31 16:26:52 +0100 <merijn> ski: Sure, but the question was "I wonder if other things will bring as much use" and I'm just arguing that "adoption rate" is a pretty good proxy metric for that :p
2022-10-31 16:27:16 +0100 <merijn> Profunctor seems much more useful than Arrow, because it's much more widely adopted and used than Arrow
2022-10-31 16:27:57 +0100 <Guest75> merjin : I think I'll agree with the adoption rate criteria :-)
2022-10-31 16:28:28 +0100 <ski> Andrew Appel in "Modern Compiler Implementation in {ML|Java|C}" in 1998 at <https://www.cs.princeton.edu/~appel/modern/> uses such a CPS `Answer' type for a pure functional language, in one chapter
2022-10-31 16:28:57 +0100 <ski> merijn : sure :b
2022-10-31 16:29:54 +0100skistill thinks `Profunctor' should probably have been named `Difunctor'
2022-10-31 16:30:36 +0100Kaiepi(~Kaiepi@108.175.84.104) (Ping timeout: 246 seconds)
2022-10-31 16:31:02 +0100 <jbggs[m]> What's a profunctor?
2022-10-31 16:31:21 +0100 <chromoblob> :t (\a b -> let const x -> y = a; x = b in y)
2022-10-31 16:31:22 +0100 <lambdabot> error: parse error on input ‘->’
2022-10-31 16:31:28 +0100 <chromoblob> :t (\a b -> let (const x -> y) = a; x = b in y)
2022-10-31 16:31:29 +0100 <lambdabot> b -> p -> Expr
2022-10-31 16:31:36 +0100darkstardevx(~darkstard@50.126.124.156)
2022-10-31 16:31:50 +0100 <chromoblob> :t (\a b -> let (const lala -> mama) = a; lala = b in mama)
2022-10-31 16:31:51 +0100 <lambdabot> error:
2022-10-31 16:31:51 +0100 <lambdabot> • Variable not in scope: lala
2022-10-31 16:31:51 +0100 <lambdabot> • Perhaps you meant one of these:
2022-10-31 16:32:48 +0100darkstardevx(~darkstard@50.126.124.156) (Remote host closed the connection)
2022-10-31 16:32:52 +0100beteigeuze(~Thunderbi@bl14-81-220.dsl.telepac.pt) (Ping timeout: 252 seconds)
2022-10-31 16:32:56 +0100 <chromoblob> :t (\a b -> let lala = b; (const lala -> mama) = a in mama)
2022-10-31 16:32:57 +0100 <lambdabot> error:
2022-10-31 16:32:57 +0100 <lambdabot> • Variable not in scope: lala
2022-10-31 16:32:57 +0100 <lambdabot> • Perhaps you meant ‘ala’ (imported from Control.Lens)
2022-10-31 16:33:12 +0100darkstardevx(~darkstard@50.126.124.156)
2022-10-31 16:33:25 +0100beteigeuze(~Thunderbi@bl14-81-220.dsl.telepac.pt)
2022-10-31 16:33:44 +0100Kaiepi(~Kaiepi@108.175.84.104)
2022-10-31 16:33:48 +0100 <ski> i'm not sure to which extent usage of `ViewPatterns' outside of function formal parameter patterns were given that much thought, in the design and implementation of the extension
2022-10-31 16:33:59 +0100 <Guest75> jbggs[m] : I also didn't understood that yet. but there are materials about it: https://www.youtube.com/watch?v=wtIKd8AhJOc&list=PLbgaMIhjbmEnaH_LTkxLI7FMa2HsnawM_&index=14
2022-10-31 16:35:35 +0100 <Guest75> jbggs[m] : e.g. at 41:10
2022-10-31 16:35:39 +0100eggplantade(~Eggplanta@2600:1700:38c5:d800:7552:8274:e242:b93b)
2022-10-31 16:35:40 +0100 <merijn> jbggs[m]: A type that is a Contravariant functor in it's first type argument, but functor in it's second argument
2022-10-31 16:36:06 +0100 <merijn> jbggs[m]: You can kinda think of "Functor" as "producers" of a value of type 'a' that you can adapt into "producers" of a new type 'b'
2022-10-31 16:36:35 +0100 <merijn> You can kinda think of Contravariant as a "sink"/"consumer" of a value of type 'a' that you can adapt into a "sink" of values of a new type 'b'
2022-10-31 16:36:45 +0100Spukgespenst(~user@user/siracusa)
2022-10-31 16:37:14 +0100 <merijn> And along those lines Profunctors would be connectors that act as a "sink" for one type that "produces" another type (so you can independently change the type it accepts and that it produces)
2022-10-31 16:38:36 +0100 <Guest75> merijn : what's usage example for that? can it be explained with such easy functors as Maybe and [ ] ?
2022-10-31 16:39:41 +0100azimut(~azimut@gateway/tor-sasl/azimut)
2022-10-31 16:39:57 +0100 <ski> i think i saw some language suggesting that the codomain of a profunctor needing to be `Set' (or `Hask', in the Haskell approximation) .. this not needing to be the case for a difunctor. but i'm not sure about this
2022-10-31 16:41:33 +0100 <ski> Guest75 : a "pipe" between threads that you can pass `a's into, and accept `b's out of, would be one example
2022-10-31 16:41:35 +0100 <jbggs[m]> I think I get the gist, but I think I'm gonna have to spend a lot more time understanding Contravariant before I get it
2022-10-31 16:42:39 +0100 <ski> imagine something like `mkPipe :: IO (Pipe a b,Pipe b a)', and then you go on using one direction in one thread, and the other in another (e.g. `forkIO'ed) thread
2022-10-31 16:43:09 +0100 <ski> or the various streaming I/O libraries, for that matter
2022-10-31 16:43:32 +0100 <Guest75> so that actually has to do with parallel Haskell
2022-10-31 16:43:52 +0100 <Guest75> web/websockets etc too
2022-10-31 16:43:55 +0100 <ski> the latter doesn't have to do with parallelism, nor (preemptive) concurrency
2022-10-31 16:44:21 +0100 <merijn> Guest75: Maybe and [] only have one type argument, so can't be Profunctors
2022-10-31 16:44:26 +0100 <Guest75> aha
2022-10-31 16:44:39 +0100 <Guest75> are pipes like CSP channels (in go or Clojure)?
2022-10-31 16:44:42 +0100 <merijn> jbggs[m]: Have you seen, for example, Conduit before?
2022-10-31 16:44:54 +0100 <ski> (well, i guess you'd produce `Pipe a a', and then `dimap' over that)
2022-10-31 16:45:00 +0100 <merijn> Guest75: "pipes" is a hand-wavy vague term without definite meaning there
2022-10-31 16:45:18 +0100 <Guest75> aha
2022-10-31 16:45:23 +0100 <merijn> Guest75: i.e. a function 'a -> b' is a profunctor it "consumes as and produces bs"
2022-10-31 16:45:42 +0100 <merijn> You can use a function "d -> a" to turn a function "a -> b" into "d -> b"
2022-10-31 16:45:44 +0100 <ski> functions are the basic example, of course
2022-10-31 16:46:06 +0100 <merijn> You can also use a function 'b -> e' to turn "a -> b" into "a -> e"
2022-10-31 16:46:34 +0100 <merijn> :t dimap
2022-10-31 16:46:34 +0100 <lambdabot> Profunctor p => (a -> b) -> (c -> d) -> p b c -> p a d
2022-10-31 16:46:34 +0100 <ski> dimap :: (a1 -> a0) -> (b0 -> b1) -> ((a0 -> b0) -> (a1 -> b1))
2022-10-31 16:46:42 +0100 <merijn> Now imagine p = "(->)" and see how that follows my exampe
2022-10-31 16:47:13 +0100 <ski> dimap :: (a1 -> a0) -> (b0 -> b1) -> (p a0 b0 -> p a1 b1) -- in the general case
2022-10-31 16:47:42 +0100 <Guest75> yes, speaking of me I have few hunderds of pages (C. Allen and B. Milewski) to comprehend yet and then I'll be able to understand that :-)
2022-10-31 16:47:50 +0100 <chromoblob> :t (\a b -> let (y, Just x) = let (const x -> y) = a in (y, b) in y)
2022-10-31 16:47:51 +0100 <lambdabot> b -> Maybe a -> a
2022-10-31 16:48:29 +0100 <chromoblob> whew
2022-10-31 16:48:54 +0100 <merijn> Guest75: tbh I haven't read that book and now fuck all about CT and I still follow the Profunctor thing :p
2022-10-31 16:48:55 +0100 <Guest75> now I only understand that p is generalization of a function (->) and then there're multiple functions/mappings/pipes etc that work together. that still has to fit with CT as well
2022-10-31 16:48:59 +0100 <merijn> Guest75: CT is overrated
2022-10-31 16:49:13 +0100 <merijn> (for productive Haskell, that is)
2022-10-31 16:49:59 +0100 <Guest75> aha... I'm not sure if CT is useful for math either. Or... is math useful :P
2022-10-31 16:50:07 +0100 <Guest75> (for programming)
2022-10-31 16:50:12 +0100 <ski> is music useful ?
2022-10-31 16:50:33 +0100foul_owl(~kerry@23.82.194.108) (Ping timeout: 246 seconds)
2022-10-31 16:50:42 +0100 <chromoblob> music useful for musicians, lets them make money :p
2022-10-31 16:50:45 +0100 <ski> math is an artform
2022-10-31 16:51:14 +0100 <Guest75> ski: yes. I have DIY alaram clock that wakes me up with "Pink Floyd - Time" every morning :-)
2022-10-31 16:51:16 +0100 <APic> No Science exists that cannot be seen as Form of Art
2022-10-31 16:52:24 +0100Guest75(~Guest75@178.141.197.193) (Quit: Client closed)
2022-10-31 16:52:36 +0100Guest75(~Guest75@178.141.197.193)
2022-10-31 16:52:43 +0100 <chromoblob> now, how to devise a general transform...
2022-10-31 16:52:59 +0100kenran(~user@user/kenran)
2022-10-31 16:53:01 +0100 <geekosaur> math is useful only to the extent that some (not all) mathematical constructs are useful in understanding or producing real world things
2022-10-31 16:53:05 +0100 <ski> (aesthetic notions, like elegance, symmetry, balance, are very important in mathematics. "for every notion of structure there ought to be a corresponding notion of structure-preserving homomorphism" is an aesthetic (deontic) judegment)
2022-10-31 16:53:49 +0100kenran(~user@user/kenran) (Remote host closed the connection)
2022-10-31 16:53:49 +0100 <geekosaur> physics understands this and regularly abuses math to get the results it wants 🙂
2022-10-31 16:53:49 +0100 <ski> @quote is.not.optional
2022-10-31 16:53:49 +0100 <lambdabot> O'Keefe says: "Elegance is not optional."
2022-10-31 16:54:34 +0100 <dolio> No they don't. They just lie about what math they're using.
2022-10-31 16:54:36 +0100 <ski> (with more elegant abstractions, things tend to be more succinct, concise, clear, orthogonal, less space for bugs to hide)
2022-10-31 16:54:42 +0100 <Guest75> In my career I only once or so used arctg (trigonometric function) to calc position of a point in a JS widget correctly. It worked very well, but I wasn't sure about edge cases
2022-10-31 16:55:12 +0100 <Guest75> I guess ppl who are good in math know everything
2022-10-31 16:55:18 +0100 <ski> nah
2022-10-31 16:56:28 +0100 <ski> "arctg" being arctangens, for computing angle from position ?
2022-10-31 16:56:48 +0100 <ski> @type atan2
2022-10-31 16:56:49 +0100 <lambdabot> RealFloat a => a -> a -> a
2022-10-31 16:56:53 +0100 <Guest75> ski: yes. I wrote function called "unrotate" to "unrotate" the point
2022-10-31 16:57:19 +0100 <ski> .. rotate backwards ?
2022-10-31 16:57:30 +0100justHauntedDeliriumTremens_
2022-10-31 16:58:59 +0100vglfr(~vglfr@145.224.100.22)
2022-10-31 17:00:12 +0100 <Guest75> ski: I've used ReactJS (to be more precise: https://nebula.gl/  this thing from Über) and a 2D map. In my fn (event handler) I already had coords of a point that was rotated or sth like this
2022-10-31 17:00:37 +0100nate3(~nate@98.45.169.16)
2022-10-31 17:00:52 +0100 <Guest75> I'm still not sure if it's as simple as rotate back (to (negate angle) of a given one)
2022-10-31 17:00:56 +0100 <ski> mhm, ic
2022-10-31 17:01:03 +0100 <dsal> The responses to the bugs I filed against postgresql-simple are pretty encouraging for my hasql port.
2022-10-31 17:01:10 +0100econo(uid147250@user/econo)
2022-10-31 17:01:51 +0100 <ski> well .. you could simply multiply by a rotation matrix, rather than mucking with `atan' or `atan2'
2022-10-31 17:02:01 +0100jao(~jao@cpc103048-sgyl39-2-0-cust502.18-2.cable.virginm.net)
2022-10-31 17:02:31 +0100 <Guest75> ski: that's 3x3 matrix right?:-)  that's why I say about math
2022-10-31 17:02:35 +0100 <chromoblob> how can i see Core code of a function without installing GHC?
2022-10-31 17:02:40 +0100ec(~ec@gateway/tor-sasl/ec) (Ping timeout: 258 seconds)
2022-10-31 17:02:43 +0100 <Guest75> affine transformations etc
2022-10-31 17:03:27 +0100 <chromoblob> i was reading "Implementing functional languages" of Simon Peyton Jones and was wondering if GHC currently uses FATBAR operator, or what does it use instead of it
2022-10-31 17:04:21 +0100 <chromoblob> THE IMPLEMENTATION
2022-10-31 17:04:21 +0100 <chromoblob> OF FUNCTIONAL
2022-10-31 17:04:22 +0100 <chromoblob> PROGRAMMING LANGUAGES
2022-10-31 17:04:24 +0100 <chromoblob> i mean
2022-10-31 17:04:34 +0100 <chromoblob> sorry for newlines
2022-10-31 17:04:34 +0100foul_owl(~kerry@23.82.194.108)
2022-10-31 17:04:45 +0100ec(~ec@gateway/tor-sasl/ec)
2022-10-31 17:04:52 +0100 <chromoblob> 1987 book
2022-10-31 17:04:57 +0100 <Guest75> ski : I agree using more standard tool like matrix might be more clear (for another developer to read the code later)
2022-10-31 17:05:21 +0100 <ski> if `(x,y)' is the original point, and you want to rotate it an angle `alpha' counter-clockwise from the positive `x'-axis, you'd compute `(x*cos(alpha)-y*sin(alpha),x*sin(alpha)+y*cos(alpha))'
2022-10-31 17:06:31 +0100 <ski> Guest75 : no, two-by-two matrix, `[[cos(alpha),sin(alpha)],[-sin(alpha),cos(alpha)]]', not three-by-three
2022-10-31 17:06:47 +0100 <Guest75> the points also have offset
2022-10-31 17:07:11 +0100 <Guest75> maybe even after rotation
2022-10-31 17:07:18 +0100 <ski> yea, so subtract the orogin around which you want to rotate, then rotate, then add it back in
2022-10-31 17:07:28 +0100 <ski> s/orogin/origin/
2022-10-31 17:08:13 +0100eggplantade(~Eggplanta@2600:1700:38c5:d800:7552:8274:e242:b93b) (Remote host closed the connection)
2022-10-31 17:09:10 +0100wootehfoot(~wootehfoo@user/wootehfoot)
2022-10-31 17:10:40 +0100 <chromoblob> for those who don't know, the book describes a function x FATBAR y = x if x /= FAIL, y otherwise, where FAIL is a special value returned by a right-hand side of an equation where pattern matching has failed
2022-10-31 17:10:43 +0100 <ski> (affine transformations are transformations of points. linear transformations are transformations of vectors. difference of two points is a vector. adding a vector to a point yields a point. often when material teaches matrices and vectors, vectors and points are blurred together)
2022-10-31 17:12:34 +0100 <ski> chromoblob : that sounds like a semantic device used to describe the meaning of programs on a mathematical level, but not (necessarily) of much use in an implementation (except perhaps proving it correct wrt a spec)
2022-10-31 17:13:31 +0100 <ski> presumably it could be used in the semantics of pattern-matching, the `case' construct (?)
2022-10-31 17:13:51 +0100 <chromoblob> ski: in the book, pattern matching is implemented by calls to FATBAR, i.e. expressions are transformed to those that contain FATBAR
2022-10-31 17:13:54 +0100 <chromoblob> book shows how to get rid of FATBAR in some cases, but not all cases
2022-10-31 17:14:12 +0100 <ski> ok
2022-10-31 17:14:59 +0100 <chromoblob> so in the implementation way that is presented by the book, FATBAR and FAIL are built-in
2022-10-31 17:15:32 +0100 <chromoblob> so i was wondering, what is in place of FATBAR in GHC
2022-10-31 17:15:50 +0100 <ski> in the implementation, presumably there's forcing of thunks, and then case analysis of tags
2022-10-31 17:16:29 +0100 <ski> i would expect there's no thing directly corresponding to this "FATBAR"
2022-10-31 17:17:35 +0100 <chromoblob> is there FAIL in GHC? the book doesn't show how completely get rid of it
2022-10-31 17:18:14 +0100 <ski> > let Just x = Nothing in x
2022-10-31 17:18:16 +0100 <lambdabot> *Exception: <interactive>:3:5-20: Non-exhaustive patterns in Just x
2022-10-31 17:19:14 +0100 <chromoblob> this simple example can be implemented using case, without FAIL at all
2022-10-31 17:19:29 +0100 <chromoblob> but there are more complex examples
2022-10-31 17:19:39 +0100maerwald_(~maerwald@mail.hasufell.de) (Quit: gone)
2022-10-31 17:19:58 +0100maerwald(~maerwald@mail.hasufell.de)
2022-10-31 17:20:29 +0100 <ski> examples that can be generated from Haskell source, and not just from this "intermediate language" using "FATBAR" and "FAIL" ?
2022-10-31 17:21:03 +0100apache2(apache2@anubis.0x90.dk)
2022-10-31 17:21:22 +0100sadmax(~user@209.205.174.253) (Remote host closed the connection)
2022-10-31 17:23:25 +0100pie_(~pie_bnc@user/pie/x-2818909) ()
2022-10-31 17:25:54 +0100kenran(~user@user/kenran)
2022-10-31 17:26:13 +0100kenran(~user@user/kenran) (Remote host closed the connection)
2022-10-31 17:28:19 +0100pie_(~pie_bnc@user/pie/x-2818909)
2022-10-31 17:28:40 +0100DeliriumTremens_justache
2022-10-31 17:30:12 +0100merijn(~merijn@86-86-29-250.fixed.kpn.net) (Ping timeout: 248 seconds)
2022-10-31 17:30:53 +0100 <chromoblob> ok i found one example in the book, but now i see that it can be transformed using let, and FATBAR probably isn't needed otherwise
2022-10-31 17:31:27 +0100 <chromoblob> the book omits the transformation using let
2022-10-31 17:32:54 +0100mbuf(~Shakthi@49.204.120.214) (Quit: Leaving)
2022-10-31 17:36:33 +0100coot(~coot@2a02:a310:e241:1b00:ec1a:e9df:79ac:66ba) (Quit: coot)
2022-10-31 17:37:42 +0100 <chromoblob> it's let f a b [] [] = a; f a b xs ys = b xs ys; f compiles to two nested case exprs on first and second list, and both (:) cases for inner and outer case expressions return (b xs ys), and book uses FATBAR to avoid duplicating the returned expression
2022-10-31 17:38:03 +0100 <chromoblob> but it can just be bound to a variable inside a let
2022-10-31 17:38:12 +0100freeside(~mengwong@bb115-66-48-84.singnet.com.sg) (Ping timeout: 248 seconds)
2022-10-31 17:39:08 +0100 <chromoblob> though, in the [] [] case the allocation of variable is unnecessary
2022-10-31 17:39:13 +0100 <monochrom> chromoblob: https://play-haskell.tomsmeding.com/ can show core code. Click the "Core" button.
2022-10-31 17:39:20 +0100 <chromoblob> thank you
2022-10-31 17:40:24 +0100 <monochrom> Eventually it is still better to install your own GHC so you have finer control.
2022-10-31 17:40:24 +0100Guest75(~Guest75@178.141.197.193) (Quit: Client closed)
2022-10-31 17:45:51 +0100 <chromoblob> lots of fluff in that core output
2022-10-31 17:46:10 +0100freeside(~mengwong@bb115-66-48-84.singnet.com.sg)
2022-10-31 17:48:09 +0100gurkenglas(~gurkengla@p548ac72e.dip0.t-ipconnect.de)
2022-10-31 17:48:33 +0100ec(~ec@gateway/tor-sasl/ec) (Remote host closed the connection)
2022-10-31 17:49:07 +0100ec(~ec@gateway/tor-sasl/ec)
2022-10-31 17:49:38 +0100Guest7596(~Guest75@178.141.197.193)
2022-10-31 17:50:28 +0100freeside(~mengwong@bb115-66-48-84.singnet.com.sg) (Ping timeout: 248 seconds)
2022-10-31 17:50:58 +0100titibandit(~titibandi@xdsl-87-79-250-160.nc.de)
2022-10-31 17:54:16 +0100motherfsck(~motherfsc@user/motherfsck) (Ping timeout: 252 seconds)
2022-10-31 17:54:16 +0100arahael(~arahael@124.168.94.52) (Ping timeout: 252 seconds)
2022-10-31 17:54:41 +0100motherfsck(~motherfsc@user/motherfsck)
2022-10-31 17:56:36 +0100king_gs(~Thunderbi@187.201.83.115)
2022-10-31 18:00:03 +0100merijn(~merijn@86-86-29-250.fixed.kpn.net)
2022-10-31 18:01:23 +0100shriekingnoise(~shrieking@186.137.167.202)
2022-10-31 18:01:43 +0100 <chromoblob> in core, in "case x of wild_abc { ... }", what is meaning of wild_abc?
2022-10-31 18:01:58 +0100freeside(~mengwong@bb115-66-48-84.singnet.com.sg)
2022-10-31 18:02:13 +0100chomwitt(~chomwitt@athe730-c-multi-217.home.otenet.gr)
2022-10-31 18:03:48 +0100nate3(~nate@98.45.169.16) (Ping timeout: 248 seconds)
2022-10-31 18:05:08 +0100 <dolio> That is an alias for the thing being scrutinized. GHC also remembers that it's guaranteed to be evaluated.
2022-10-31 18:05:57 +0100titibandit(~titibandi@xdsl-87-79-250-160.nc.de) (Quit: Leaving.)
2022-10-31 18:06:01 +0100troydm(~troydm@host-176-37-124-197.b025.la.net.ua)
2022-10-31 18:06:28 +0100freeside(~mengwong@bb115-66-48-84.singnet.com.sg) (Ping timeout: 248 seconds)
2022-10-31 18:07:18 +0100arahael(~arahael@124.168.94.52)
2022-10-31 18:08:36 +0100 <probie> You'll also see `sat_abc` but I've never looked into what the `sat_` actually means
2022-10-31 18:08:44 +0100eggplantade(~Eggplanta@2600:1700:38c5:d800:7552:8274:e242:b93b)
2022-10-31 18:09:06 +0100Guest38(~Guest38@76.128.170.130)
2022-10-31 18:10:17 +0100zer0bitz(~zer0bitz@196.244.192.57)
2022-10-31 18:10:45 +0100Guest38(~Guest38@76.128.170.130) (Client Quit)
2022-10-31 18:13:09 +0100eggplantade(~Eggplanta@2600:1700:38c5:d800:7552:8274:e242:b93b) (Ping timeout: 255 seconds)
2022-10-31 18:13:14 +0100coot(~coot@2a02:a310:e241:1b00:ec1a:e9df:79ac:66ba)
2022-10-31 18:13:31 +0100zer0bitz_(~zer0bitz@196.244.192.57) (Ping timeout: 252 seconds)
2022-10-31 18:14:37 +0100freeside(~mengwong@bb115-66-48-84.singnet.com.sg)
2022-10-31 18:14:42 +0100eggplantade(~Eggplanta@2600:1700:38c5:d800:7552:8274:e242:b93b)
2022-10-31 18:15:55 +0100coot(~coot@2a02:a310:e241:1b00:ec1a:e9df:79ac:66ba) (Client Quit)
2022-10-31 18:16:34 +0100coot(~coot@2a02:a310:e241:1b00:ec1a:e9df:79ac:66ba)
2022-10-31 18:16:36 +0100wootehfoot(~wootehfoo@user/wootehfoot) (Ping timeout: 248 seconds)
2022-10-31 18:18:40 +0100irrgit_(~irrgit@146.70.27.218)
2022-10-31 18:19:27 +0100freeside(~mengwong@bb115-66-48-84.singnet.com.sg) (Ping timeout: 255 seconds)
2022-10-31 18:22:31 +0100wootehfoot(~wootehfoo@user/wootehfoot)
2022-10-31 18:23:11 +0100sadmax(~user@209.205.174.253)
2022-10-31 18:23:51 +0100python47`(~user@88.160.31.174)
2022-10-31 18:24:17 +0100python476(~user@88.160.31.174) (Read error: Connection reset by peer)
2022-10-31 18:27:58 +0100sadmax(~user@209.205.174.253) (Remote host closed the connection)
2022-10-31 18:29:13 +0100sadmax(~user@209.205.174.253)
2022-10-31 18:29:35 +0100Kaiepi(~Kaiepi@108.175.84.104) (Ping timeout: 246 seconds)
2022-10-31 18:29:44 +0100sadmax(~user@209.205.174.253) (Read error: Connection reset by peer)
2022-10-31 18:30:07 +0100pie_(~pie_bnc@user/pie/x-2818909) (Read error: Connection reset by peer)
2022-10-31 18:30:24 +0100sadmax(~user@209.205.174.253)
2022-10-31 18:30:34 +0100merijn(~merijn@86-86-29-250.fixed.kpn.net) (Ping timeout: 252 seconds)
2022-10-31 18:30:58 +0100pie_(~pie_bnc@user/pie/x-2818909)
2022-10-31 18:34:33 +0100darkstardevx(~darkstard@50.126.124.156) (Read error: Connection reset by peer)
2022-10-31 18:34:47 +0100darkstardevx(~darkstard@50.126.124.156)
2022-10-31 18:34:49 +0100beteigeuze(~Thunderbi@bl14-81-220.dsl.telepac.pt) (Remote host closed the connection)
2022-10-31 18:35:04 +0100beteigeuze(~Thunderbi@bl14-81-220.dsl.telepac.pt)
2022-10-31 18:35:35 +0100freeside(~mengwong@bb115-66-48-84.singnet.com.sg)
2022-10-31 18:39:00 +0100machinedgod(~machinedg@d198-53-218-113.abhsia.telus.net) (Ping timeout: 248 seconds)
2022-10-31 18:39:48 +0100tzh(~tzh@c-24-21-73-154.hsd1.or.comcast.net)
2022-10-31 18:40:05 +0100freeside(~mengwong@bb115-66-48-84.singnet.com.sg) (Ping timeout: 246 seconds)
2022-10-31 18:42:11 +0100merijn(~merijn@86-86-29-250.fixed.kpn.net)
2022-10-31 18:42:38 +0100redmp(~redmp@mobile-166-170-43-64.mycingular.net)
2022-10-31 18:44:05 +0100python47`(~user@88.160.31.174) (Remote host closed the connection)
2022-10-31 18:45:18 +0100Kaiepi(~Kaiepi@108.175.84.104)
2022-10-31 18:47:04 +0100merijn(~merijn@86-86-29-250.fixed.kpn.net) (Ping timeout: 252 seconds)
2022-10-31 18:50:44 +0100Kaiepi(~Kaiepi@108.175.84.104) (Ping timeout: 248 seconds)
2022-10-31 19:02:25 +0100Feuermagier_(~Feuermagi@154.28.188.170) (Quit: Leaving)
2022-10-31 19:02:45 +0100 <chromoblob> okay, i finally managed to create an example where expressions in cases are duplicated thus: case x of { A _ -> case y of { A _ -> ...; abcy -> f x abcy; }; abcx -> f abcx y; }; here (f x abcy) and (f abcx y) is same
2022-10-31 19:03:01 +0100 <chromoblob> GHC doesn't optimize this, even with -O2
2022-10-31 19:04:02 +0100Kaiepi(~Kaiepi@108.175.84.104)
2022-10-31 19:05:09 +0100 <probie> They're not the same are they? If `A _` doesn't match, `y` doesn't need to be in whnf for `f abcx y`
2022-10-31 19:05:26 +0100 <L29Ah> are there haskell testing frameworks that make it easy to launch the program (main) with various args and check results?
2022-10-31 19:05:31 +0100 <EvanR> chromoblob, if you want "everything is an extension of some 'more basic' thing" it's interesting to pick coroutine for that
2022-10-31 19:05:43 +0100 <probie> s/`A _` doesn't match/`A _` doesn't match for x/
2022-10-31 19:05:46 +0100jao(~jao@cpc103048-sgyl39-2-0-cust502.18-2.cable.virginm.net) (Ping timeout: 252 seconds)
2022-10-31 19:05:50 +0100 <EvanR> more often people try everything is an object, or everything is a set first
2022-10-31 19:06:56 +0100Inoperable(~PLAYER_1@fancydata.science) (Quit: All your buffer are belong to us!)
2022-10-31 19:07:22 +0100 <probie> chromoblob: out of curiosity, does it optimise it if you write "y `seq` case x of { A _ -> case y of { A _ -> ...; abcy -> f x abcy; }; abcx -> f abcx y; };"?
2022-10-31 19:07:23 +0100 <EvanR> in the case of process calculi, everything is a process, but coroutine would be a special case of implementation of that
2022-10-31 19:08:01 +0100jao(~jao@cpc103048-sgyl39-2-0-cust502.18-2.cable.virginm.net)
2022-10-31 19:08:29 +0100 <sm> L29Ah: I think most of them show examples of a minimal main module, and offer an api that can select specific tests, but you have to hook those up yourself, processing command line args
2022-10-31 19:08:50 +0100tdammers(~tdammers@77.109.72.118.res.static.edpnet.net) (Ping timeout: 250 seconds)
2022-10-31 19:08:52 +0100freeside(~mengwong@bb115-66-48-84.singnet.com.sg)
2022-10-31 19:09:36 +0100 <sm> Happy Hallowe'en all 🎃
2022-10-31 19:09:46 +0100 <L29Ah> sm: i mean the testing framework running my program in its entirety, as opposed to unit testing
2022-10-31 19:10:08 +0100 <probie> sm: Happy first of November
2022-10-31 19:10:10 +0100 <L29Ah> and comparing its output against other program for example
2022-10-31 19:10:27 +0100 <sm> ohh.. yes my shelltestrunner is one
2022-10-31 19:10:32 +0100 <EvanR> is Halloween is only appropriate time to suggest a new extension -XFRankeNTypes
2022-10-31 19:10:38 +0100eggplantade(~Eggplanta@2600:1700:38c5:d800:7552:8274:e242:b93b) (Remote host closed the connection)
2022-10-31 19:11:04 +0100 <sm> probie: wow, belated then
2022-10-31 19:11:39 +0100 <EvanR> what in gods name timezone is it already Nov 1
2022-10-31 19:12:05 +0100 <probie> GMT+11. It's 5am
2022-10-31 19:12:11 +0100 <sm> australia I'm thinking
2022-10-31 19:12:15 +0100Inoperable(~PLAYER_1@fancydata.science)
2022-10-31 19:13:15 +0100 <L29Ah> sm: interesting, can it be integrated with cabal nicely? hledger doesn't do that it seems
2022-10-31 19:13:56 +0100 <sm> L29Ah: no particular suppor for that, maybe a custom Setup could do it ?
2022-10-31 19:13:56 +0100 <chromoblob> probie: no, it only adds an enclosing case which implements the seq
2022-10-31 19:15:16 +0100 <EvanR> chromoblob, I was told CSE (when they actually are the same express even) is not commonly used. This example doesn't even get there
2022-10-31 19:16:18 +0100 <EvanR> CSE can cause unwanted sharing which could be bad
2022-10-31 19:16:26 +0100 <sm> L29Ah: or I guess a test suite that runs it
2022-10-31 19:17:38 +0100 <chromoblob> EvanR: how is sharing bad, you mean more memory will be used?
2022-10-31 19:18:40 +0100 <L29Ah> https://github.com/bennofs/hcltest/ looks the best so far but it's abandoned :<
2022-10-31 19:18:46 +0100irrgit_(~irrgit@146.70.27.218) (Read error: Connection reset by peer)
2022-10-31 19:18:48 +0100 <ski> sharing is sometimes good, sometimes bad
2022-10-31 19:19:04 +0100 <EvanR> in the base case scenario you use very little memory because of lazy evaluation, the pieces being evaluated for temporary purposes are quickly collected
2022-10-31 19:19:12 +0100 <EvanR> best case*
2022-10-31 19:19:35 +0100 <ski> use very little memory, at the same time
2022-10-31 19:20:16 +0100 <EvanR> time dependent memory *thonk*
2022-10-31 19:20:23 +0100 <EvanR> memory at time t
2022-10-31 19:21:38 +0100 <chromoblob> EvanR: did you know that classes (structs) are coroutines? fields are state for coroutine, and every method sends a message to the coroutine
2022-10-31 19:22:06 +0100 <EvanR> sounds like everything is a ism
2022-10-31 19:22:41 +0100 <EvanR> https://wiki.c2.com/?EverythingIsa
2022-10-31 19:25:04 +0100tdammers(~tdammers@77.109.72.118.res.static.edpnet.net)
2022-10-31 19:25:08 +0100king_gs(~Thunderbi@187.201.83.115) (Read error: Connection reset by peer)
2022-10-31 19:25:27 +0100king_gs(~Thunderbi@2806:103e:29:47b9:f34b:ffff:4cfc:90a6)
2022-10-31 19:26:32 +0100 <EvanR> you can get a lot done in haskell thinking everything is an expression to be evaluated, perhaps with the possible "result" of ⊥
2022-10-31 19:28:58 +0100Guest(~Guest@185.216.186.110)
2022-10-31 19:29:21 +0100Guest(~Guest@185.216.186.110) (Client Quit)
2022-10-31 19:29:37 +0100Guest2944(~Guest29@185.216.186.110)
2022-10-31 19:32:13 +0100 <Guest2944> Hello. I have a question. A binary tree in Haskell is data BinaryTree a = Leaf | Node a (BinaryTree a) (BinaryTree a). Is it possible to add a parent pointer?
2022-10-31 19:32:22 +0100 <chromoblob> yes
2022-10-31 19:32:53 +0100 <EvanR> no, but you can express paths to a place in the tree using another data type
2022-10-31 19:33:17 +0100 <EvanR> also called a one hole context
2022-10-31 19:33:39 +0100 <EvanR> and a one hole context + the subtree at that location is called a zipper
2022-10-31 19:33:40 +0100 <chromoblob> data BinaryTree a = Leaf (Maybe (BinaryTree a)) | Node a (BinaryTree a) (BinaryTree a) (Maybe (BinaryTree a))
2022-10-31 19:34:02 +0100 <chromoblob> every Maybe (BinaryTree a) is Nothing if no parent, or Just parent
2022-10-31 19:35:53 +0100 <Guest2944> Evan, thank you, I will have to google zipper and context
2022-10-31 19:36:55 +0100 <EvanR> specifically, one hole context
2022-10-31 19:36:55 +0100 <geekosaur> chromoblob, the problem with that is you need to use a lazy update / "tying the knot" to get the parent pointer in there, and updates become very difficult
2022-10-31 19:36:56 +0100 <monochrom> chromoblob: Regarding the haskell playground outputting too much: This is why it is advantageous to run your own GHC, because then you can specify -dsuppress-all (or more fine-grained -dsuppress-* options) for less verbose output.
2022-10-31 19:37:04 +0100 <geekosaur> one-hole contexts work better
2022-10-31 19:37:59 +0100 <Guest2944> chromoblob, did you successfully work with this or is it an idea?
2022-10-31 19:38:07 +0100 <chromoblob> just idea
2022-10-31 19:39:04 +0100 <probie> geekosaur: that might depend on what you're doing. If the tree is static and you just walk it, "tying the knot" will probably be more efficient
2022-10-31 19:39:17 +0100 <sclv> L29Ah , sm : if a test-suite has a build-tools-depends on an executable, then the code in the test suite can proceed with the executable in the path
2022-10-31 19:39:26 +0100 <EvanR> yeah updating the tree is pretty easy when it's not required
2022-10-31 19:39:32 +0100 <geekosaur> well, yes, that'swhy I specified updates
2022-10-31 19:39:45 +0100 <monochrom> Guest2944: https://wiki.haskell.org/Zipper may help. This is not parent pointer. However, it solves a lot of the problems that imperative people use parent pointers to solve.
2022-10-31 19:39:46 +0100 <geekosaur> if you're just walking it, no problem
2022-10-31 19:39:59 +0100 <EvanR> chromoblob's thing might be good as a read-only tree
2022-10-31 19:40:03 +0100 <sm> sclv: +1
2022-10-31 19:40:24 +0100 <Guest2944> monochrom, thanks
2022-10-31 19:40:25 +0100 <EvanR> still pretty noisy though
2022-10-31 19:40:30 +0100 <probie> My mistake, I thought you made two separate statements when really they were one
2022-10-31 19:40:38 +0100 <sm> though, doesn't the user have to ensure it's installed ?
2022-10-31 19:40:43 +0100 <monochrom> I may actually go bold and claim they solve the exact same problems.
2022-10-31 19:41:07 +0100 <sclv> what if the problem that a parent pointer solves is "i want a pointer to a location in memory" :-P
2022-10-31 19:41:14 +0100 <sm> I doubt shelltestrunner is on cabals list of auto-installable tools
2022-10-31 19:41:24 +0100 <EvanR> sclv sounds like an XY problem xD
2022-10-31 19:41:39 +0100 <sclv> build-tool-depends can specify any executable in any haskell package.
2022-10-31 19:41:41 +0100 <EvanR> even in C locations in memory is usually not relevant, while pointers are
2022-10-31 19:41:59 +0100 <sclv> including an executable provided by the same package the test suite is for iirc
2022-10-31 19:42:38 +0100 <sclv> the only "magic" list cabal has that isn't really extensible yet is _auto preprocessors_ like cpp, c2hs, etc
2022-10-31 19:43:21 +0100 <monochrom> sclv: Haha you got me.
2022-10-31 19:43:28 +0100 <EvanR> though C and Haskell both let you basically do int * ptr = 1234 if "necessary" xD
2022-10-31 19:43:41 +0100 <EvanR> *1234 = 9
2022-10-31 19:44:29 +0100 <probie> EvanR: Not treating them as "locations in memory", but you might be treating them as numbers if you're silly enough to "save" a word when implementing doubly-linked lists in C
2022-10-31 19:45:09 +0100 <chromoblob> damn, XOR linked lists are cool
2022-10-31 19:45:50 +0100 <monochrom> struct unary_nat { struct unary_nat *next; }; /* >:) */
2022-10-31 19:47:26 +0100 <sm> sclv: cool, I did not know that
2022-10-31 19:47:44 +0100 <EvanR> NULL was a billion dollar mistake while zero was called "the singlemost important technological advancement of mankind" ? xD
2022-10-31 19:48:08 +0100 <chromoblob> xD
2022-10-31 19:48:40 +0100 <sclv> https://cabal.readthedocs.io/en/stable/cabal-package.html#pkg-field-build-tool-depends
2022-10-31 19:48:44 +0100 <monochrom> Perhaps all technological advancements are billion dollar mistakes, too. >:)
2022-10-31 19:50:54 +0100biberu(~biberu@user/biberu) (Read error: Connection reset by peer)
2022-10-31 19:52:29 +0100 <chromoblob> i opened https://wiki.haskell.org/Zipper and read phrase "differentiating the data structure", interesting, what is that? link there is dead
2022-10-31 19:53:44 +0100 <monochrom> Try https://en.wikibooks.org/wiki/Haskell/Zippers#Differentiation_of_data_types
2022-10-31 19:54:45 +0100biberu(~biberu@user/biberu)
2022-10-31 19:55:07 +0100 <EvanR> I got so caught up in differentiating data types I never really understood zippers. So that's why I didn't mention it xD
2022-10-31 19:55:10 +0100 <monochrom> You can also look for footnote 6 Conor McBride's paper "The Derivative of a Regular Type is its Type of One-Hole Contexts".
2022-10-31 19:55:40 +0100 <geekosaur> http://strictlypositive.org/diff.pdf
2022-10-31 19:55:55 +0100 <EvanR> by just solving your zipper problem in isolation maybe you can accomplish the task and get a raise, and do hilarious calculus later
2022-10-31 19:57:58 +0100 <monochrom> Well, I get my zipper from formal differentiation. It's faster and less error-prone than "think about it".
2022-10-31 19:58:01 +0100motherfsck(~motherfsc@user/motherfsck) (Ping timeout: 252 seconds)
2022-10-31 19:58:36 +0100 <monochrom> I do not know why differentiation gives the correct answer, to be sure.
2022-10-31 19:59:02 +0100 <EvanR> there is a paragraph on that at the end of mcbride's paper
2022-10-31 19:59:06 +0100wootehfoot(~wootehfoo@user/wootehfoot) (Read error: Connection reset by peer)
2022-10-31 19:59:15 +0100merijn(~merijn@86-86-29-250.fixed.kpn.net)
2022-10-31 19:59:16 +0100 <EvanR> about what partial differentiation even is
2022-10-31 19:59:32 +0100 <monochrom> So, my view is just use the formula to accomplish the task and get a raise, and understand hilarious calculus later!
2022-10-31 19:59:39 +0100 <EvanR> though he doesn't seem to be sure either
2022-10-31 20:00:42 +0100 <monochrom> This may be up there in the same genre as "why do quantum wave functions give probabilities?" :)
2022-10-31 20:01:02 +0100 <geekosaur> or just ignore the question and use it because it works, like me 🙂
2022-10-31 20:01:09 +0100____________boo___
2022-10-31 20:01:10 +0100___boo____________
2022-10-31 20:01:24 +0100geekosaurnot very interested in type theory, much less the calculus thereof
2022-10-31 20:01:54 +0100 <dolio> The obvious answer is that it's exactly the same operation that mathematicians do on polynomials. The only deep question is why the operation on polynomials (which are syntactic expressions) has anything to do with other stuff in calculus.
2022-10-31 20:03:01 +0100 <monochrom> There may be some Lie Algebra reason going on behind both.
2022-10-31 20:03:06 +0100 <dolio> But you could already be asking that question in math if it weren't obscured over there.
2022-10-31 20:03:14 +0100 <EvanR> I bet whatever the answer is, it's spelled with category theory xD
2022-10-31 20:03:34 +0100aliosablack(~chomwitt@2a02:587:dc18:4a00:1ac0:4dff:fedb:a3f1)
2022-10-31 20:04:06 +0100 <dolio> Because mathematicians are so bad at keeping syntax vs semantics and expressions vs. functions straight. :þ
2022-10-31 20:04:27 +0100 <dolio> At least, when teaching stuff.
2022-10-31 20:05:11 +0100 <L29Ah> sclv: then it means sticking with cabal-v1 as build-tools-depends is picky // https://github.com/haskell/cabal/issues/8434
2022-10-31 20:06:00 +0100 <EvanR> mcbride says maybe it's not what varying x means that is important but what else is staying the same (which is relevant for zippers)
2022-10-31 20:06:00 +0100 <sclv> no it doesn't.
2022-10-31 20:06:16 +0100chomwitt(~chomwitt@athe730-c-multi-217.home.otenet.gr) (Ping timeout: 252 seconds)
2022-10-31 20:06:22 +0100 <sclv> iirc build-tool-depends doesn't even really work with v1 stuff very well.
2022-10-31 20:06:36 +0100 <EvanR> we hold all the other variables constant for a partial derivative
2022-10-31 20:06:37 +0100 <sclv> it works great with v2 stuff -- it just doesn't have a mechanism for external package managers to hook into it yet!
2022-10-31 20:06:56 +0100 <EvanR> which corresponds to the branches not taken in a one-hole context
2022-10-31 20:08:17 +0100 <EvanR> ---
2022-10-31 20:08:30 +0100 <EvanR> and so in calculus, probably very little in the rules of differentiation has anything to do with calculus xD
2022-10-31 20:08:46 +0100 <L29Ah> sclv: in v1 it does work, as seen in https://github.com/gentoo-haskell/gentoo-haskell/issues/1074
2022-10-31 20:09:07 +0100 <sclv> vis a vis one hole types and derivatives this is the same as the operation on combinatorial species, and you can connect that operation, categorically, to lawvere's axiomitization of synthetic differential geometry
2022-10-31 20:09:53 +0100 <EvanR> "I knew it"
2022-10-31 20:10:39 +0100 <chromoblob> "Amusingly, the following power series resembles list x" OMG, division by types?
2022-10-31 20:10:43 +0100motherfsck(~motherfsc@user/motherfsck)
2022-10-31 20:11:05 +0100 <chromoblob> but that's not quotient types
2022-10-31 20:11:07 +0100eggplantade(~Eggplanta@2600:1700:38c5:d800:7552:8274:e242:b93b)
2022-10-31 20:11:10 +0100 <sclv> anyway i maintain it works fine for v2 stuff if you don't try to make it interact with an external package manager
2022-10-31 20:11:31 +0100chele(~chele@user/chele) (Remote host closed the connection)
2022-10-31 20:11:46 +0100 <EvanR> the power series for the list type looks like division just formally
2022-10-31 20:11:57 +0100 <EvanR> (or is it just formally)
2022-10-31 20:12:08 +0100freeside(~mengwong@bb115-66-48-84.singnet.com.sg) (Ping timeout: 246 seconds)
2022-10-31 20:12:41 +0100 <EvanR> (rather could that formal formula "keep going" into the laws of fields lol)
2022-10-31 20:12:46 +0100 <monochrom> Ugh Leibniz, not Newton?! >:)
2022-10-31 20:13:16 +0100 <EvanR> at least, the derivative of that formula (1 / (1 - x))^2 is the right answer
2022-10-31 20:13:45 +0100 <EvanR> the classic zipper
2022-10-31 20:13:54 +0100 <dolio> Right, all those syntactic rules work on power series, and expressions equivalent to formal power series.
2022-10-31 20:15:31 +0100 <dolio> Probably by definition?
2022-10-31 20:15:33 +0100eggplantade(~Eggplanta@2600:1700:38c5:d800:7552:8274:e242:b93b) (Ping timeout: 255 seconds)
2022-10-31 20:15:37 +0100 <sclv> i think the "related work" section of d-for-data covers briefly the connection i mentioned http://www.strictlypositive.org/dfordata.pdf
2022-10-31 20:17:02 +0100Nolrai(~Nolrai@c-67-171-154-216.hsd1.or.comcast.net)
2022-10-31 20:18:05 +0100 <sclv> i think one can probably derive the intuition for why the syntactic rules arise from the underlying math vis a vis normal derivatives by considering the purely formal structure of synthetic differential stuff the right way -- that would be a great article to read!
2022-10-31 20:19:24 +0100zeenk(~zeenk@2a02:2f04:a105:5d00:c862:f190:2ea:d494) (Quit: Konversation terminated!)
2022-10-31 20:21:56 +0100 <EvanR> thanks sclv my afternoon is now shot
2022-10-31 20:23:23 +0100 <sclv> on the last, here is a good book if you have not seen https://users-math.au.dk/kock/sdg99.pdf
2022-10-31 20:24:36 +0100 <monochrom> That would shot a whole year :)
2022-10-31 20:24:47 +0100 <monochrom> err, shoot! Damn English.
2022-10-31 20:26:05 +0100 <EvanR> honestly would shot seems cromulent
2022-10-31 20:26:36 +0100 <dolio> Yeah, I imagine the rules for everything fall out via some 'obvious' analogues stuff you could do via rings.
2022-10-31 20:28:24 +0100 <dolio> Like, derivatives in SDG are kind of like, 'take your polynomial, and evaluate it on x+dx inside R[x,dx]/(dx^2 = 0).'
2022-10-31 20:28:31 +0100jakalx(~jakalx@base.jakalx.net) (Error from remote client)
2022-10-31 20:28:57 +0100 <dolio> Or R[[x]][dx]/(dx^2 = 0), where [[x]] means power series.
2022-10-31 20:32:05 +0100 <sclv> i think for the basics its really only page 1-18 of the book. and if you don't care about categorical models, only pages 1-90 for the "whole thing"
2022-10-31 20:32:10 +0100 <dolio> And regular types are like formal power series on the 'ring of types'.
2022-10-31 20:33:09 +0100sadmax`(~user@209.205.174.253)
2022-10-31 20:33:29 +0100merijn(~merijn@86-86-29-250.fixed.kpn.net) (Ping timeout: 246 seconds)
2022-10-31 20:34:19 +0100sadmax(~user@209.205.174.253) (Ping timeout: 252 seconds)
2022-10-31 20:34:28 +0100Everything(~Everythin@37.115.210.35)
2022-10-31 20:35:53 +0100jakalx(~jakalx@base.jakalx.net)
2022-10-31 20:36:08 +0100darkstardevx(~darkstard@50.126.124.156) (Read error: Connection reset by peer)
2022-10-31 20:36:18 +0100darkstardevx(~darkstard@50.126.124.156)
2022-10-31 20:36:36 +0100titibandit(~titibandi@xdsl-87-79-250-160.nc.de)
2022-10-31 20:36:39 +0100Guest7596(~Guest75@178.141.197.193) (Ping timeout: 244 seconds)
2022-10-31 20:37:37 +0100beteigeuze(~Thunderbi@bl14-81-220.dsl.telepac.pt) (Ping timeout: 252 seconds)
2022-10-31 20:37:41 +0100Nolrai(~Nolrai@c-67-171-154-216.hsd1.or.comcast.net) (Ping timeout: 244 seconds)
2022-10-31 20:37:57 +0100beteigeuze(~Thunderbi@bl14-81-220.dsl.telepac.pt)
2022-10-31 20:40:11 +0100titibandit(~titibandi@xdsl-87-79-250-160.nc.de) (Client Quit)
2022-10-31 20:40:38 +0100freeside(~mengwong@bb115-66-48-84.singnet.com.sg)
2022-10-31 20:41:27 +0100tzh_(~tzh@c-24-21-73-154.hsd1.wa.comcast.net)
2022-10-31 20:42:14 +0100ski. o O ( "Objects of Categories as Complex Numbers" by Marcelo Fiore,Tom Leinster in 2002-12-30 at <https://arxiv.org/abs/math/0212377> ; <https://golem.ph.utexas.edu/category/2009/07/searching_for_a_video_proof_of.html> ; "This Week's Finds in Mathematical Physics (Week 202)" by John Baez in 2004-02-21 at <https://math.ucr.edu/home/baez/week202.html> ; "Seven Trees in One" by Andreas Blass in 1995
2022-10-31 20:42:20 +0100skiat <https://dept.math.lsa.umich.edu/~ablass/cat.html> )
2022-10-31 20:44:13 +0100tzh(~tzh@c-24-21-73-154.hsd1.or.comcast.net) (Ping timeout: 252 seconds)
2022-10-31 20:48:06 +0100king_gs(~Thunderbi@2806:103e:29:47b9:f34b:ffff:4cfc:90a6) (Ping timeout: 268 seconds)
2022-10-31 20:50:39 +0100mjs2600(~mjs2600@c-24-91-3-49.hsd1.vt.comcast.net) (Quit: ZNC 1.8.2 - https://znc.in)
2022-10-31 20:50:40 +0100coot(~coot@2a02:a310:e241:1b00:ec1a:e9df:79ac:66ba) (Quit: coot)
2022-10-31 20:52:15 +0100mjs2600(~mjs2600@c-24-91-3-49.hsd1.vt.comcast.net)
2022-10-31 20:55:29 +0100Tuplanolla(~Tuplanoll@91-159-69-11.elisa-laajakaista.fi)
2022-10-31 21:10:57 +0100 <chromoblob> is there a ready made program for computing seven trees from one, i'd take a look
2022-10-31 21:12:14 +0100eggplantade(~Eggplanta@2600:1700:38c5:d800:c9d:1a05:4084:603c)
2022-10-31 21:15:48 +0100ddellacosta(~ddellacos@143.244.47.76) (Ping timeout: 248 seconds)
2022-10-31 21:16:45 +0100eggplantade(~Eggplanta@2600:1700:38c5:d800:c9d:1a05:4084:603c) (Ping timeout: 255 seconds)
2022-10-31 21:17:53 +0100 <EvanR> :t \x -> (x,x,x,x,x,x,x) -- xD
2022-10-31 21:17:54 +0100 <lambdabot> g -> (g, g, g, g, g, g, g)
2022-10-31 21:18:57 +0100 <geekosaur> what?
2022-10-31 21:19:02 +0100 <geekosaur> oh
2022-10-31 21:19:10 +0100 <geekosaur> I think it wasn't meant that way
2022-10-31 21:21:33 +0100merijn(~merijn@86-86-29-250.fixed.kpn.net)
2022-10-31 21:21:33 +0100 <geekosaur> but I'm not going to try to read it because "cat" suggests to me some CT thing being involved with how one tree can represent 7
2022-10-31 21:26:39 +0100merijn(~merijn@86-86-29-250.fixed.kpn.net) (Ping timeout: 255 seconds)
2022-10-31 21:28:15 +0100 <chromoblob> okay the program is here http://blog.sigfpe.com/2007/09/arboreal-isomorphisms-from-nuclear.html
2022-10-31 21:28:32 +0100coot(~coot@2a02:a310:e241:1b00:ec1a:e9df:79ac:66ba)
2022-10-31 21:30:15 +0100 <ski> it's a (non-recursively defined) bijection between `Tree' and `(Tree,Tree,Tree,Tree,Tree,Tree,Tree)', where `data Tree = Tip | Branch Tree Tree'
2022-10-31 21:30:47 +0100 <yin> what's the advantage of using Word8 over Word (besides range) ?
2022-10-31 21:30:48 +0100 <EvanR> T = 1 + T^2, has a solution 0.5 + 0.866i, which is sixth root of 1, i.e. 1 = T^6
2022-10-31 21:31:03 +0100 <EvanR> or T = T^7
2022-10-31 21:32:37 +0100 <EvanR> it has the feel of some bogus thing someone in high school math would try to pull on the teacher xD
2022-10-31 21:33:02 +0100 <EvanR> (to prove that 1 tree = 7 trees)
2022-10-31 21:34:15 +0100michalz(~michalz@185.246.207.221) (Remote host closed the connection)
2022-10-31 21:35:04 +0100 <dolio> Well, it's not particularly surprising than an infinite set is isomorphic to its own 7-fold product. The particular example is more involved than just that, though.
2022-10-31 21:38:44 +0100merijn(~merijn@86-86-29-250.fixed.kpn.net)
2022-10-31 21:40:12 +0100ec(~ec@gateway/tor-sasl/ec) (Ping timeout: 258 seconds)
2022-10-31 21:40:14 +0100mmhat(~mmh@p200300f1c730765eee086bfffe095315.dip0.t-ipconnect.de) (Ping timeout: 276 seconds)
2022-10-31 21:40:56 +0100sadmax`(~user@209.205.174.253) (Remote host closed the connection)
2022-10-31 21:40:59 +0100ec(~ec@gateway/tor-sasl/ec)
2022-10-31 21:41:28 +0100 <tomsmeding> while the fact that T is set-isomorphic to T^7 is not very surprising, it would be _very_ surprising if 1 = T^6
2022-10-31 21:41:42 +0100 <tomsmeding> not just surprising, clearly false
2022-10-31 21:42:06 +0100 <tomsmeding> EvanR: so I fear there is some part of your deduction that doesn't follow ;)
2022-10-31 21:43:04 +0100 <EvanR> yeah don't worry about the 1 = T^6
2022-10-31 21:43:38 +0100 <EvanR> the paper explains why it's ok that makes no sense for types but it does for complex numbers
2022-10-31 21:44:07 +0100 <dolio> The point is that when 1 = T^6 holds for e.g. complex numbers, T = T^7 holds in a more general class of rings.
2022-10-31 21:44:37 +0100 <dolio> When you interpret T into both.
2022-10-31 21:46:17 +0100freeside(~mengwong@bb115-66-48-84.singnet.com.sg) (Ping timeout: 246 seconds)
2022-10-31 21:48:44 +0100raehik(~raehik@cpc95906-rdng25-2-0-cust156.15-3.cable.virginm.net) (Ping timeout: 246 seconds)
2022-10-31 21:51:02 +0100mokee(~mokee@37.228.215.235) (Remote host closed the connection)
2022-10-31 21:53:02 +0100mmhat(~mmh@p200300f1c7307603ee086bfffe095315.dip0.t-ipconnect.de)
2022-10-31 21:56:43 +0100 <monochrom> False statements are extremely surprising, in information theory. >:)
2022-10-31 21:58:41 +0100caryhartline(~caryhartl@2600:1700:2d0:8d30:8d35:fb39:2b22:5607)
2022-10-31 22:03:21 +0100titibandit(~titibandi@xdsl-87-79-250-160.nc.de)
2022-10-31 22:05:19 +0100ec(~ec@gateway/tor-sasl/ec) (Remote host closed the connection)
2022-10-31 22:05:42 +0100ec(~ec@gateway/tor-sasl/ec)
2022-10-31 22:09:07 +0100rburkholder(~blurb@96.45.2.121) (Quit: Leaving)
2022-10-31 22:09:28 +0100rburkholder(~blurb@96.45.2.121)
2022-10-31 22:11:50 +0100merijn(~merijn@86-86-29-250.fixed.kpn.net) (Ping timeout: 246 seconds)
2022-10-31 22:13:49 +0100freeside(~mengwong@bb115-66-48-84.singnet.com.sg)
2022-10-31 22:17:52 +0100 <darkling> ... true or false? ;)
2022-10-31 22:18:06 +0100 <EvanR> or file not found
2022-10-31 22:18:37 +0100jakalx(~jakalx@base.jakalx.net) (Error from remote client)
2022-10-31 22:19:28 +0100 <darkling> It's a little-known fact that George Boole was an amateur carpenter, but kept forgetting where he put his tools.
2022-10-31 22:19:50 +0100jakalx(~jakalx@base.jakalx.net)
2022-10-31 22:19:53 +0100 <monochrom> He needs more bits for his memory. >:)
2022-10-31 22:21:03 +0100jmdaemon(~jmdaemon@user/jmdaemon)
2022-10-31 22:21:15 +0100Everything(~Everythin@37.115.210.35) (Quit: leaving)
2022-10-31 22:31:20 +0100 <hpc> he needed more bits for his drill too
2022-10-31 22:31:37 +0100 <monochrom> haha
2022-10-31 22:34:21 +0100 <darkling> Well played.
2022-10-31 22:34:49 +0100titibandit(~titibandi@xdsl-87-79-250-160.nc.de) (Remote host closed the connection)
2022-10-31 22:37:51 +0100darkstarx(~darkstard@50.126.124.156)
2022-10-31 22:40:16 +0100darkstardevx(~darkstard@50.126.124.156) (Ping timeout: 252 seconds)
2022-10-31 22:41:40 +0100vglfr(~vglfr@145.224.100.22) (Ping timeout: 248 seconds)
2022-10-31 22:42:15 +0100albet70(~xxx@2400:8902::f03c:92ff:fe60:98d8) (Ping timeout: 255 seconds)
2022-10-31 22:46:10 +0100vglfr(~vglfr@145.224.100.22)
2022-10-31 22:49:58 +0100coot(~coot@2a02:a310:e241:1b00:ec1a:e9df:79ac:66ba) (Quit: coot)
2022-10-31 22:51:24 +0100emad(~emad@156.214.225.151)
2022-10-31 22:52:18 +0100 <koz> I'm a bit confused about the free Applicative. Specifically, suppose I wanted to define an equivalent to Reader with it.
2022-10-31 22:52:35 +0100 <koz> I have no idea how to give it the capability to do (the equivalent of) `local`.
2022-10-31 22:54:03 +0100emad(~emad@156.214.225.151) (Client Quit)
2022-10-31 22:55:03 +0100lagash(lagash@lagash.shelltalk.net) (Quit: ZNC - https://znc.in)
2022-10-31 22:55:15 +0100lagash(lagash@lagash.shelltalk.net)
2022-10-31 22:56:16 +0100dcoutts(~duncan@host86-163-164-210.range86-163.btcentralplus.com) (Ping timeout: 255 seconds)
2022-10-31 22:58:00 +0100thonkpod_(~thonkpod@user/thonkpod) (Ping timeout: 255 seconds)
2022-10-31 22:59:02 +0100thonkpod_(~thonkpod@user/thonkpod)
2022-10-31 22:59:23 +0100Guest71(~Guest71@78-68-106-126-no2000.tbcn.telia.com)
2022-10-31 22:59:50 +0100merijn(~merijn@86-86-29-250.fixed.kpn.net)
2022-10-31 22:59:53 +0100Guest71(~Guest71@78-68-106-126-no2000.tbcn.telia.com) (Client Quit)
2022-10-31 23:00:03 +0100Guest71(~Guest71@78-68-106-126-no2000.tbcn.telia.com)
2022-10-31 23:00:34 +0100talismanick(~talismani@c-73-41-86-39.hsd1.ca.comcast.net)
2022-10-31 23:03:31 +0100zmt01(~zmt00@user/zmt00)
2022-10-31 23:04:28 +0100merijn(~merijn@86-86-29-250.fixed.kpn.net) (Ping timeout: 252 seconds)
2022-10-31 23:04:53 +0100albet70(~xxx@2400:8902::f03c:92ff:fe60:98d8)
2022-10-31 23:05:06 +0100bitdex(~bitdex@gateway/tor-sasl/bitdex)
2022-10-31 23:07:36 +0100zmt00(~zmt00@user/zmt00) (Ping timeout: 250 seconds)
2022-10-31 23:08:05 +0100thegeekinside(~thegeekin@189.180.115.115)
2022-10-31 23:09:43 +0100takuan(~takuan@178-116-218-225.access.telenet.be) (Remote host closed the connection)
2022-10-31 23:14:01 +0100eggplantade(~Eggplanta@2600:1700:38c5:d800:c9d:1a05:4084:603c)
2022-10-31 23:14:49 +0100__monty__(~toonn@user/toonn) (Quit: leaving)
2022-10-31 23:14:55 +0100Midjak2(~Midjak@82.66.147.146) (Quit: Leaving)
2022-10-31 23:15:32 +0100Midjak(~Midjak@82.66.147.146)
2022-10-31 23:15:36 +0100Midjak2(~Midjak@82.66.147.146)
2022-10-31 23:15:54 +0100acidjnk(~acidjnk@p200300d6e7137a36f0ab6f680c2cefbd.dip0.t-ipconnect.de) (Ping timeout: 246 seconds)
2022-10-31 23:16:00 +0100Midjak2(~Midjak@82.66.147.146) (Client Quit)
2022-10-31 23:16:00 +0100Midjak(~Midjak@82.66.147.146) (Client Quit)
2022-10-31 23:17:29 +0100merijn(~merijn@86-86-29-250.fixed.kpn.net)
2022-10-31 23:17:56 +0100freeside(~mengwong@bb115-66-48-84.singnet.com.sg) (Ping timeout: 248 seconds)
2022-10-31 23:18:23 +0100jinsunGuest9966
2022-10-31 23:18:23 +0100jinsun__(~jinsun@user/jinsun)
2022-10-31 23:18:23 +0100Guest9966(~jinsun@user/jinsun) (Killed (sodium.libera.chat (Nickname regained by services)))
2022-10-31 23:18:23 +0100jinsun__jinsun
2022-10-31 23:18:42 +0100eggplantade(~Eggplanta@2600:1700:38c5:d800:c9d:1a05:4084:603c) (Ping timeout: 255 seconds)
2022-10-31 23:19:33 +0100hueso(~root@user/hueso) (Ping timeout: 272 seconds)
2022-10-31 23:19:59 +0100hueso(~root@user/hueso)
2022-10-31 23:23:14 +0100merijn(~merijn@86-86-29-250.fixed.kpn.net) (Ping timeout: 246 seconds)
2022-10-31 23:26:21 +0100aliosablack(~chomwitt@2a02:587:dc18:4a00:1ac0:4dff:fedb:a3f1) (Ping timeout: 255 seconds)
2022-10-31 23:36:04 +0100gmg(~user@user/gehmehgeh) (Quit: Leaving)
2022-10-31 23:36:07 +0100freeside(~mengwong@bb115-66-48-84.singnet.com.sg)
2022-10-31 23:40:46 +0100freeside(~mengwong@bb115-66-48-84.singnet.com.sg) (Ping timeout: 252 seconds)
2022-10-31 23:42:18 +0100 <talismanick> I'm translating the example (SML?) code from the Wikipedia page on Normalization by Evaluation, and ran into a snag midway through: it generates fresh (unique) variable IDs while mutual recursing
2022-10-31 23:42:57 +0100 <talismanick> newUnique's type is IO Unique, so I need to somehow thread unique values through it
2022-10-31 23:43:39 +0100 <ski> pass in an infinite list of unique values ?
2022-10-31 23:43:52 +0100 <talismanick> I have a few options: pass them as arguments explicitly, lift the computation into a free monad, or think really hard and unroll the mutual recursion
2022-10-31 23:44:16 +0100 <ski> (possibly state-threading, if you have more than one recursive call (in the same branch))
2022-10-31 23:44:21 +0100 <monochrom> The minimum requirement is a state monad.
2022-10-31 23:44:39 +0100 <monochrom> Use the state to help you generate fresh IDs.
2022-10-31 23:44:43 +0100 <ski> (well, possibly you could use a split operation, as well)
2022-10-31 23:44:49 +0100 <talismanick> ski: Hm, yeah, that's a bit more elegant
2022-10-31 23:45:10 +0100 <talismanick> (than the first option of just prepending `Unique ->` to the signature)
2022-10-31 23:45:55 +0100 <monochrom> OK, mine is just one of the two minimums. The other is a reader monad plus a split operation. :)
2022-10-31 23:46:32 +0100 <talismanick> It does mean it's up to the caller to build a "correct" (infinite) list, but it's a small price in clarity otherwise
2022-10-31 23:47:24 +0100 <talismanick> just `forM_ (newUnique <$ [1..]) $ <normalize by evaluation, blah blah>`
2022-10-31 23:47:36 +0100 <talismanick> wait, that's not right, but you get the idea...
2022-10-31 23:48:17 +0100gabriel_sevecek(~gabriel@188-167-229-200.dynamic.chello.sk) (Quit: WeeChat 3.7)
2022-10-31 23:48:25 +0100 <koz> Anyone able to assist me with my free-Applicative-based definition of Reader with local?
2022-10-31 23:48:32 +0100 <koz> I genuinely have no idea how to write such a thing.
2022-10-31 23:48:56 +0100gabriel_sevecek(~gabriel@188-167-229-200.dynamic.chello.sk)
2022-10-31 23:49:52 +0100johnw(~johnw@2600:1700:cf00:db0:6c87:b668:9831:2008) (Quit: ZNC - http://znc.in)
2022-10-31 23:50:52 +0100 <koz> Essentially, I need to figure out the f so I can write 'newtype MyReader a = MyReader (Ap f a)', so I can define 'local' on it.
2022-10-31 23:51:25 +0100 <koz> The bit that confuses me is that, unlike 'ask', local takes an already-defined computation, so I have no idea if that needs to be in 'f' somehow.
2022-10-31 23:54:01 +0100freeside(~mengwong@bb115-66-48-84.singnet.com.sg)
2022-10-31 23:54:57 +0100 <geekosaur> isn't f irrelevant to local? it cares only about the a
2022-10-31 23:55:24 +0100 <geekosaur> and we know because Functor f => Applicative f that f doesn't matter there
2022-10-31 23:55:27 +0100 <koz> geekosaur: How would you define 'local' then?
2022-10-31 23:55:42 +0100 <koz> This is the part I'm not getting here.
2022-10-31 23:58:35 +0100 <koz> I believe that 'f' needs to be something like 'ReaderF r a where Ask :: ReaderF r r'