Add voidM to Control.Monad
sol at typeful.net
Mon Jan 16 19:05:11 CET 2012
> >> voidM :: Monad m => m a -> m ()
> >> voidM m = m >> return ()
> > Is voidM meant to be used with instance of Monad that are no monads, and
> > hence have no Functor instance (like HtmlM)?
> You could easily implement a Functor instance for this type, since it
> would mirror the instance for `Const a` , i.e. only change the type
> parameter, and otherwise be the identity function.
Yes, you are right. As long as we do not use bind we are fine.
More information about the Libraries