Safe Haskell | None |
---|---|
Language | Haskell2010 |
Annotating monads with tags to turn untagged constraints into tagged ones.
import qualified Control.Monad.State as T import Control.Ether.TH (ethereal) import Control.Monad.Ether.State (MonadState) import Control.Ether.Wrapped (ethered) ethereal "Foo" "foo" f :: T.MonadState Int m => m String f = fmap show T.get g :: MonadState Foo Int m => m String g = ethered foo f
- newtype WrappedEther tag m a = WrapEther {
- unwrapEther :: m a
- ethered :: proxy tag -> WrappedEther tag m a -> m a
Documentation
newtype WrappedEther tag m a Source
Wrap a monad to attach a tag to it.
WrapEther | |
|
MonadReader tag r m => MonadReader tag r (WrappedEther tag' m) Source | |
MonadState tag s m => MonadState tag s (WrappedEther tag' m) Source | |
MonadExcept tag e m => MonadExcept tag e (WrappedEther tag' m) Source | |
MonadWriter tag w m => MonadWriter tag w (WrappedEther tag' m) Source | |
MonadExcept tag e m => MonadError e (WrappedEther tag m) Source | |
MonadReader tag r m => MonadReader r (WrappedEther tag m) Source | |
MonadState tag s m => MonadState s (WrappedEther tag m) Source | |
MonadWriter tag w m => MonadWriter w (WrappedEther tag m) Source | |
Monad m => Monad (WrappedEther tag m) Source | |
Functor m => Functor (WrappedEther tag m) Source | |
MonadFix m => MonadFix (WrappedEther tag m) Source | |
Applicative m => Applicative (WrappedEther tag m) Source | |
Alternative m => Alternative (WrappedEther tag m) Source | |
MonadPlus m => MonadPlus (WrappedEther tag m) Source | |
MonadIO m => MonadIO (WrappedEther tag m) Source |
ethered :: proxy tag -> WrappedEther tag m a -> m a Source
Annotate a polymorphic monadic computation with a tag.