It's because the Monad Transformer Library (MTL) recognizes that it's quite common for you to stack monads in just that way so they don't define tell
as just some function (Mondoid w) => w -> Writer ()
.
Instead they have MonadWriter
which is defined as a typeclass with tell as a function in it. Then they define a ton of instances of MonadWriter
: ReaderT
, IO
, Writer
(duh) etc. And thus you avoid the annoying repetition of lift.
.
This is quite common, any monad transformer (in MTL) will have a Control.Monad.***.Class
which has this sort of typeclass.