circular definitions in "Monads as Containers"
Submitted by metaperl on Tue, 04/18/2006 - 10:13pm.
::
We first see
What bind does is to take a container of type (m a) and a function of type (a -> m b). It first maps the function over the container, (which would give an m (m b)) and then applies join to the result to get a container of type (m b).
But then we see
Joining is equivalent to binding a container with the identity map. This is indeed still called join in Haskell:
So then the question becomes: if bind uses join and join uses bind, then we have a serious circularity issue...
- metaperl's blog
- Login to post comments
Of course you can't do both at the same time. My goal was to show that it was possible to define either one in terms of the other. (One of the two has to do something type-specific.)