Newest at the top
2025-02-03 23:49:32 +0100 | <ncf> | "state retracts onto reader" i guess |
2025-02-03 23:49:06 +0100 | <ncf> | i guess they mean something different; they also require a left inverse |
2025-02-03 23:47:52 +0100 | <ncf> | https://leventerkok.github.io/papers/erkok-thesis.pdf says embeddings instead of proper submonads (see ยง4.6) |
2025-02-03 23:47:07 +0100 | <tomsmeding> | oh right, preservation of pure and join is sufficient, then you automatically preserve equations on the monad operations in the domain |
2025-02-03 23:46:32 +0100 | <ncf> | https://hackage.haskell.org/package/mmorph-1.2.0/docs/Control-Monad-Morph.html |
2025-02-03 23:46:21 +0100 | merijn | (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 246 seconds) |
2025-02-03 23:46:18 +0100 | <ncf> | yes (well i just mean it's not invertible) |
2025-02-03 23:45:56 +0100 | <ncf> | preserves the operations (pure and join) |
2025-02-03 23:45:54 +0100 | <tomsmeding> | and does the "proper" in "proper submonad" mean that said monad morphism is not surjective? |
2025-02-03 23:45:13 +0100 | <tomsmeding> | "monad morphism" meaning "preserves the equations"? (excuse my ignorance) |
2025-02-03 23:44:51 +0100 | <ncf> | namely \(Reader f) -> State (\x -> (f x, x)) |
2025-02-03 23:44:32 +0100 | <ncf> | it means there's an injective monad morphism from Reader s to State s |
2025-02-03 23:43:46 +0100 | <tomsmeding> | proper subset |
2025-02-03 23:43:41 +0100 | <tomsmeding> | does that mean "you have a subset of the operations at your disposal, and they obey the same equations as they did in State"? |
2025-02-03 23:43:01 +0100 | gorignak | (~gorignak@user/gorignak) gorignak |
2025-02-03 23:42:54 +0100 | <ncf> | reader is a proper submonad of state |
2025-02-03 23:42:30 +0100 | gorignak | (~gorignak@user/gorignak) (Quit: quit) |
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 |