Copyright | © 2016–present Mark Karpov |
---|---|
License | BSD 3 clause |
Maintainer | Mark Karpov <markkarpov92@gmail.com> |
Stability | experimental |
Portability | portable |
Safe Haskell | Safe-Inferred |
Language | GHC2021 |
The library provides a monad transformer that works just like
IdentityT
, but can be tagged at the type level. This allows us to work
with monad stacks as usual, except we can make two identical monad stacks
to have different types. The main application for this is, of course, the
ability to have different instances for otherwise identical stacks
without having to do newtype
wrapping.
Synopsis
- 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 | |
|
Instances
mapTaggedT :: (m a -> n b) -> TaggedT tag m a -> TaggedT tag n b Source #
Lift a unary operation to the new monad.