42 ms·
> performs some side effects (I/O for instance), What you're describing is the IO monad to first approximation, most monads don't perform side-effects at all (
by freyrs3 13y ago
> performs some side effects (I/O for instance),
What you're describing is the IO monad to first approximation, most monads don't perform side-effects at all ( List, Cont, Maybe, ... ) and the bind operations only performs some pure overloaded operation specific to the monad instance. For example the list monad performs the concatMap function which is pure.
instance Monad [] where
m >>= f = concat (map f m)
return x = [x]