Copyright | © 2016 Mark Karpov |
---|---|
License | BSD 3 clause |
Maintainer | Mark Karpov <markkarpov@openmailbox.org> |
Stability | experimental |
Portability | portable |
Safe Haskell | Safe |
Language | Haskell2010 |
Control.Monad.Trans.Identity.Tagged
Description
The module provides a monad transformer that works just like IdentityT
,
but can be tagged at 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, 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.
Constructors
TaggedT | |
Fields
|
Instances
mapTaggedT :: (m a -> n b) -> TaggedT tag m a -> TaggedT tag n b Source #
Lift a unary operation to the new monad.