[Haskell-beginners] Monad problem

Marcin Mrotek marcin.jan.mrotek at gmail.com
Sun Jul 12 13:14:24 UTC 2015


You're welcome :)

Though I made a mistake in my previous post, if the getUserWhatever
function did IO, i.e. had a type like (MonadBaseControl IO m => m a),
then of course you could also use it in IO directly, but of course
running it with runIdentity would no longer work.

Btw. for the record, instead of something like "MonadBaseControl IO m"
you may see "MonadBase IO m" or just "MonadIO m" (of which MonadBase
is a generalization, to allow other base monads than just IO). All
three type classes have instances for IO, so it doesn't matter at all
if you use it like above (though MonadBaseControl and MonadBase
require MultiParamTypeclasses and FunctionalDependencies extensions,
so they might not work in compilers other than GHC) it only matters
when implementing instances for other monads, as MonadBaseControl
requires one to implement a little more complicated methods.

Best regards,
Marcin Mrotek


More information about the Beginners mailing list