[Haskell-cafe] Can we come out of a monad?
rpglover64 at gmail.com
Fri Jul 30 11:50:46 EDT 2010
Here is my understanding with respect to the question.
In the general case, you cannot come out of a monad, because the monad
typeclass does not include any functions without of the form (m a -> a).
Also, as a category theoretic construct, a monad does not have to have an
exit function. (caveat: I have a very limited grasp of what that means).
I also found myself thinking about list as a monad in terms of this
discussion. I think it's an interesting case: it's pure, but it doesn't
really make sense to "come out of it". Head, indexing, and last all break
out of it, but none of them can be the default, and all of them require you
to consider it as something more than its monad-ness.
On Fri, Jul 30, 2010 at 3:11 PM, Stefan Holdermans <stefan at vectorfabrics.com
> > In fact, I would argue that a monad which you cannot escape from is not
> very useful at all. IO is the only exception I know of.
> And that's only because, at least the runtime system allows for execution
> of a computation inside the IO monad at top-level.
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Haskell-Cafe