Newest at the top
2025-02-03 23:41:50 +0100 | merijn | (~merijn@host-vr.cgnat-g.v4.dfn.nl) merijn |
2025-02-03 23:39:55 +0100 | <tomsmeding> | it really is more powerful |
2025-02-03 23:39:50 +0100 | <tomsmeding> | a Reader traversal of a tree can be done in parallel; a Stateful traversal cannot |
2025-02-03 23:39:20 +0100 | <tomsmeding> | if so, then yes |
2025-02-03 23:39:07 +0100 | <tomsmeding> | does not reset the state, you mean? |
2025-02-03 23:38:45 +0100 | merijn | (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 244 seconds) |
2025-02-03 23:35:55 +0100 | ljdarj1 | ljdarj |
2025-02-03 23:35:54 +0100 | ljdarj | (~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 +0100 | tnt2 | tnt1 |
2025-02-03 23:34:19 +0100 | tnt1 | (~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 +0100 | merijn | (~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 +0100 | tnt2 | (~Thunderbi@user/tnt1) tnt1 |
2025-02-03 23:32:52 +0100 | ljdarj1 | (~Thunderbi@user/ljdarj) ljdarj |
2025-02-03 23:32:50 +0100 | gorignak | (~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 +0100 | gorignak | (~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 +0100 | plitter | (~plitter@user/plitter) plitter |
2025-02-03 23:29:06 +0100 | chele | (~chele@user/chele) (Remote host closed the connection) |
2025-02-03 23:28:28 +0100 | peterbecich | (~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 +0100 | plitter | (~plitter@user/plitter) (Ping timeout: 245 seconds) |
2025-02-03 23:25:31 +0100 | tnt2 | tnt1 |
2025-02-03 23:25:31 +0100 | tnt1 | (~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 +0100 | Smiles | (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 +0100 | tnt2 | (~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 +0100 | takuan | (~takuan@d8D86B601.access.telenet.be) (Remote host closed the connection) |
2025-02-03 23:23:19 +0100 | merijn | (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 252 seconds) |
2025-02-03 23:22:39 +0100 | gorignak | (~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 +0100 | gorignak | (~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? |