
7 Jun
2004
7 Jun
'04
5:53 p.m.
On 2004 June 07 Monday 15:19, Ron de Bruijn wrote:
newtype S a = State -> (a,State) -- functor T to map objects mapS::(a-> b) -> (S a -> S b) -- functor T to map morphisms unitS :: a -> S a --\eta joinS::S(S a)-> S a -- \mu
This is a complete monad using a direct mapping from Category Theory. I really like it, because it's mathematically grounded. But I don't know how to map this to Haskell monads using the standard "bind" and "return", as I explain below.
Wadler's "The Essence of Functional Programming" goes into monads to the point of relating map, unit, and join to bind and return. http://homepages.inf.ed.ac.uk/wadler/topics/monads.html