[Haskell-cafe] special term describing f :: (Monad m) => (a ->
m b) ?
robdockins at fastmail.fm
Tue Dec 14 11:27:57 EST 2004
Ralf Hinze wrote:
>>What is a function of the followning type called:
>>f :: (Monad m) => (a -> m b)
>>Is there a special term describing such a function (a function into a monad)?
> It is often called a procedure or an effectful function (I assume that
> `a' and `b' are not meant to be universally quantified). I sometimes
> use a special arrow -|> for this type.
> Cheers, Ralf
I can understand how calling this kind of function "effectual" makes
sense in the "magic" IO monad, or perhaps even in the ST and State
monads, because the term seems to imply side-effects. However, it is a
misnomer for eg, the Error, List and Cont monads. Most (all but IO)
monads are actually just ways of simplifying the expression of truly
pure functions. It seems to me that terms like "procedure" and
"effectual function" blur the distinction between the special IO monad
and all the others. I think this is an important point, because many
people new to Haskell are confused about what monads are and how they
work; it is generally some time before they realize that IO is special
and begin to understand how the other monads fit in. I think we would
do a disservice to perpetuate terminology which encourages this
Unfortunatly, I don't have a better idea. Perhaps someone more clever
than I can invent/find a term which captures the relavant concept.
More information about the Haskell-Cafe