Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(comment thread) The adjunction that induces the Reader monad #19

Open
runarorama opened this issue Sep 30, 2015 · 2 comments
Open

(comment thread) The adjunction that induces the Reader monad #19

runarorama opened this issue Sep 30, 2015 · 2 comments

Comments

@runarorama
Copy link
Owner

No description provided.

@gasche
Copy link

gasche commented Sep 30, 2015

There are several ways to turn a given monad into an adjunction, which give different adjunctions. One of them is rather trivial: if you go to the Kleisli category (whose arrows A -> B are just the A -> M B of the original category), and then come back through the forgetful functor, you have an adjunction. I think that the corresponding comonad is just the identity, which is quite boring. The Kleisli category gives the "initial" adjunction for your monad, and the "terminal" adjunction is given by the Eilenberg-Moore category of the monad -- a bit less simple, but it also works in all cases.

I believe that neither of those two constructions coincide with the one given in the StackOverflow answer, which is in a sense "more interesting". I don't know where it comes from, but I would bet it is from a non-trivial reflection on this particular monad, rather than by mechanically applying a technique that would work for any monad (like the Kleisli and Eilenberg-Moore constructions).

@runarorama
Copy link
Owner Author

Yeah, we had considered the Kleisli and Eilenberg-Moore constructions, but since that works in every case it's not very interesting and it seemed dissatisfying that Reader would be "prime" in that sense. I guess the construction given here is only slightly more interesting, but it seems like it's just the curry/uncurry adjunction with constraints bolted on to make it work. Rather like saying "Reader is just State without put". Although I suppose it's some comfort that this construction only works with this particular monad.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants