2025/02/03

Newest at the top

2025-02-03 23:38:45 +0100merijn(~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 244 seconds)
2025-02-03 23:35:55 +0100ljdarj1ljdarj
2025-02-03 23:35:54 +0100ljdarj(~Thunderbi@user/ljdarj) (Ping timeout: 265 seconds)
2025-02-03 23:35:10 +0100 <dminuoso> "backwards" in the sense that backtracking does not reset
2025-02-03 23:35:01 +0100 <dminuoso> oh right
2025-02-03 23:34:48 +0100 <tomsmeding> or use State
2025-02-03 23:34:46 +0100 <tomsmeding> if you want to do something with the leaves of a tree dependent on the how many'th leaf that is, you'll have to manually thread through a counter
2025-02-03 23:34:19 +0100tnt2tnt1
2025-02-03 23:34:19 +0100tnt1(~Thunderbi@user/tnt1) (Ping timeout: 252 seconds)
2025-02-03 23:34:10 +0100 <tomsmeding> Reader's `local` modifies the "state" when going downwards
2025-02-03 23:34:09 +0100merijn(~merijn@host-vr.cgnat-g.v4.dfn.nl) merijn
2025-02-03 23:33:53 +0100 <tomsmeding> (speaking about a normal recursive function over a (possibly virtual) tree data structure here, but the same applies to a cata)
2025-02-03 23:33:27 +0100 <tomsmeding> towards the root of the recursion tree
2025-02-03 23:33:16 +0100 <dminuoso> upwards in what sense?
2025-02-03 23:33:06 +0100 <tomsmeding> State allows you to propagate state _upwards_ too
2025-02-03 23:32:56 +0100tnt2(~Thunderbi@user/tnt1) tnt1
2025-02-03 23:32:52 +0100ljdarj1(~Thunderbi@user/ljdarj) ljdarj
2025-02-03 23:32:50 +0100gorignak(~gorignak@user/gorignak) gorignak
2025-02-03 23:32:47 +0100 <dminuoso> It seems almost as if state is just slightly more convenient in that you dont need to indent subsequent expressions into local, and that difference largely disappears in recursion schemes
2025-02-03 23:32:33 +0100 <geekosaur> just because it was in the original MTL paper, I think
2025-02-03 23:32:19 +0100gorignak(~gorignak@user/gorignak) (Quit: quit)
2025-02-03 23:31:18 +0100 <dminuoso> Well, it made me ponder about why we have State in the first place.
2025-02-03 23:30:39 +0100plitter(~plitter@user/plitter) plitter
2025-02-03 23:29:06 +0100chele(~chele@user/chele) (Remote host closed the connection)
2025-02-03 23:28:28 +0100peterbecich(~Thunderbi@syn-047-229-123-186.res.spectrum.com) (Ping timeout: 252 seconds)
2025-02-03 23:28:20 +0100 <ncf> does it? that just seems like the standard usage of Reader with local
2025-02-03 23:27:28 +0100plitter(~plitter@user/plitter) (Ping timeout: 245 seconds)
2025-02-03 23:25:31 +0100tnt2tnt1
2025-02-03 23:25:31 +0100tnt1(~Thunderbi@user/tnt1) (Ping timeout: 252 seconds)
2025-02-03 23:25:25 +0100 <dminuoso> It is kind of curious how Reader suddenly becomes a State monad in recurscion schemes.
2025-02-03 23:25:00 +0100Smiles(uid551636@id-551636.lymington.irccloud.com) (Quit: Connection closed for inactivity)
2025-02-03 23:24:37 +0100 <haskellbridge> <thirdofmay18081814goya> very neat, thanks for the reference!
2025-02-03 23:24:15 +0100tnt2(~Thunderbi@user/tnt1) tnt1
2025-02-03 23:24:02 +0100 <dminuoso> See https://hackage.haskell.org/package/recursion-schemes-5.2.3/docs/Data-Functor-Foldable.html#v:cataA
2025-02-03 23:23:45 +0100 <dminuoso> Anyway. You can either use Reader or produce functions, and you can do both with plain old cata too. cataA is really just to promote discoverability.
2025-02-03 23:23:23 +0100takuan(~takuan@d8D86B601.access.telenet.be) (Remote host closed the connection)
2025-02-03 23:23:19 +0100merijn(~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 252 seconds)
2025-02-03 23:22:39 +0100gorignak(~gorignak@user/gorignak) gorignak
2025-02-03 23:22:24 +0100 <haskellbridge> <thirdofmay18081814goya> right
2025-02-03 23:22:11 +0100 <dminuoso> You cant just magically conjure state without.. doing something.
2025-02-03 23:22:08 +0100gorignak(~gorignak@user/gorignak) (Quit: quit)
2025-02-03 23:21:58 +0100 <dminuoso> Well you need to change something.
2025-02-03 23:21:38 +0100 <haskellbridge> <thirdofmay18081814goya> the "a" in the algebra "t a -> a"
2025-02-03 23:21:32 +0100 <dminuoso> Just give the haddock of `cataA` a thorough read, including the note about producing functions in cata.
2025-02-03 23:20:45 +0100 <dminuoso> What do you mean by carrier type?
2025-02-03 23:20:29 +0100 <haskellbridge> <thirdofmay18081814goya> the carrier type
2025-02-03 23:20:17 +0100 <haskellbridge> <thirdofmay18081814goya> dminuoso: but this would require changing the type first right?
2025-02-03 23:19:49 +0100 <haskellbridge> <thirdofmay18081814goya> huh never dealt with cata + effects
2025-02-03 23:19:43 +0100 <dminuoso> (And you can do this with plain cata too)
2025-02-03 23:19:18 +0100 <dminuoso> Idea being to do this over a Reader Int effect