@@ -16,6 +16,34 @@
19+Type-level machinery to manipulate constraints on the monad
22+Out of the box it provides the following dispatch strategies:
24+* 'tagAttach' to use functions defined using untagged monad classes
25+ as if they were defined using tagged ones.
27+* 'tagReplace' to use functions defined using one tag
28+ as if they were defined using another one.
30+> import qualified Control.Monad.State as T
31+> import Control.Ether.TH (ethereal)
32+> import Control.Monad.Ether.State (MonadState)
33+> import Control.Monad.Trans.Ether.Dispatch (tagAttach, tagDispatch)
35+> ethereal "Foo" "foo"
36+> ethereal "Bar" "bar"
38+> f :: T.MonadState Int m => m String
41+> g :: MonadState Foo Int m => m String
44+> h :: MonadState Bar Int m => m String
45+> h = tagReplace foo bar g
21module Control.Monad.Trans.Ether.Dispatch
49module Control.Monad.Trans.Ether.Dispatch
@@ -27,9 +55,6 @@ module Control.Monad.Trans.Ether.Dispatch
27 , K_TagReplace(..)
55 , K_TagReplace(..)
28 , tagAttach
56 , tagAttach
29 , tagReplace
57 , tagReplace
30− -- * Newtype operations
35import Control.Applicative
60import Control.Applicative