News for hackers. Stuff that matters.
Re:Swift Functors, Applicatives, and Monads in Pictures by tel on Wednesday July 15, 2015 @02:02AM (#9889934)
It does given a Functor definition. Typically in Category Theoretic presentations Monad is defined as a functor T along with mu and nu, operations that are (a -> T a) and (T (T a) -> T a), 'unit' and 'join'.

The rules for Monad are perfectly well-stated in terms of join—perhaps even better stated if you're one to like Category Theoretic diagram chasing.

Re:Swift Functors, Applicatives, and Monads in Pictures by AdieuToLogic on Wednesday July 15, 2015 @12:56PM (#9892450)
Again, you are quite right. I did not present the other ways to define a conforming Monad and may have mistakenly implied that the unit/flatMap form is "the" way to make one.

For completeness, the forms I am aware of are (in no particular order):

* unit and flatMap

* unit and compose

* unit, map, and join

The valid form which you reference being a model of the last one.

AFAIK, for any container 'T' to be able to satisfy the Monad laws, at least one of the aforementioned three combinators must exist for the container.

Re:Swift Functors, Applicatives, and Monads in Pictures by dragonwriter on Wednesday July 15, 2015 @03:10PM (#9893388)
> AFAIK, for any container 'T' to be able to satisfy the Monad laws, at least one of the aforementioned three combinators must exist for the container.

All three of them must, actually, since if one of them exists, all of them do (and you can define the other two in terms of the one you know.)

Re:Swift Functors, Applicatives, and Monads in Pictures by dllthomas on Wednesday July 15, 2015 @02:39PM (#9893180)
"Compose" being Kleisli composition?