ether-0.1.0.0: Monad transformers and classes

Safe HaskellNone
LanguageHaskell2010

Control.Ether.Wrapped

Description

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

Synopsis

Documentation

newtype WrappedEther tag m a Source

Wrap a monad to attach a tag to it.

Constructors

WrapEther 

Fields

unwrapEther :: m a
 

ethered :: proxy tag -> WrappedEther tag m a -> m a Source

Annotate a polymorphic monadic computation with a tag.