Copyright | © 2016–2017 Mark Karpov |
---|---|
License | BSD 3 clause |
Maintainer | Mark Karpov <markkarpov92@gmail.com> |
Stability | experimental |
Portability | portable |
Safe Haskell | Safe |
Language | Haskell2010 |
The module provides a monad transformer that works just like IdentityT
,
but can be tagged at the type level. This allows to work with monad
stacks as usual, but you can make two identical monad stacks have
different types. The main application of this is, of course, the ability
to have different instances for otherwise the same stacks without having
to do opaque newtype
wrapping which is not handy with monad stacks.
- newtype TaggedT tag f a = TaggedT {
- runTaggedT :: f a
- mapTaggedT :: (m a -> n b) -> TaggedT tag m a -> TaggedT tag n b
- liftCallCC :: CallCC m a b -> CallCC (TaggedT tag m) a b
- liftCatch :: Catch e m a -> Catch e (TaggedT tag m) a
The tagged identity monad transformer
newtype TaggedT tag f a Source #
Identity monad transformer with a type-level tag.
TaggedT | |
|
mapTaggedT :: (m a -> n b) -> TaggedT tag m a -> TaggedT tag n b Source #
Lift a unary operation to the new monad.