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...

Submitted by Cale Gibbard on Wed, 04/19/2006 - 6:33am.

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.)

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.