Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Documentation
newtype TransT t (m :: Type -> Type) a Source #
Utility newtype that can be used to derive type class instances just using
MonadTrans
.
We often derive some MonadBlaBla
instance for ReaderT
by using lift
from MonadTrans
. Which is fine, but it gets laborious if you do the same
for ExceptT
, StateT
and WriterT
, even though the method implementations
are exactly the same. TransT
allows you to write one MonadTrans
-based
instance, which can then be used with DerivingVia
to use that one
implementation for all monad transformers that use that same lifting
implementation.
TransT (t m a) |