[Haskell-cafe] Explaining monads
Brian Brunswick
brian at ithil.org
Tue Aug 14 13:53:01 EDT 2007
On 14/08/07, Jeff Polakow <jeff.polakow at db.com> wrote:
>
> Of course, the type [Int] denotes a value which is a list of Ints;
> additionally [Int] can be viewed as a value representing the
> nondeterministic computation of a single Int. Generally, the type Monad m =>
> m Int can be viewed as a value representing the computation of an Int.
But thats not really right. What exactly m Int does /depends/ on m. It might
represent 0 or more computations
of Int, or computations of Int carrying some extra stuff around, or complex
control logic about what the computation does
when.
All that is really given, is that we can feed another 'Int->m a' thingy to
it using bind, and get back an m a, and the
thingy we fed in might even be used zero or more times while doing it.
These 'thingy's are called Kleisli Arrows, by the way.
--
Brian_Brunswick____brian at ithil.org____Wit____Disclaimer____!Shortsig_rules!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/haskell-cafe/attachments/20070814/8e478d64/attachment.htm
More information about the Haskell-Cafe
mailing list