on master help sign in
Do not define custom liftCatch
690bc44Index Int
src/Control/Monad/Trans/Ether/Reader.hs+1−6
@@ -24,7 +24,6 @@ module Control.Monad.Trans.Ether.Reader
24 , ask
24 , ask
25 , local
25 , local
26 -- * Lifting other operations
26 -- * Lifting other operations
27− , liftCatch
28 , liftCallCC
27 , liftCallCC
29 ) where
28 ) where
30
29
@@ -126,10 +125,6 @@ withReaderT
126 -> ReaderT tag r' m a
125 -> ReaderT tag r' m a
127withReaderT t f m = tagged t $ Trans.withReaderT f (coerce m)
126withReaderT t f m = tagged t $ Trans.withReaderT f (coerce m)
128
127
129−-- | Lift a @catchE@ operation to the new monad.
130−liftCatch :: proxy tag -> Sig.Catch e m a -> Sig.Catch e (ReaderT tag r m) a
131−liftCatch t f m h = tagged t $ Trans.liftCatch f (coerce m) (coerce h)
132−
133-- | Lift a @callCC@ operation to the new monad.
128-- | Lift a @callCC@ operation to the new monad.
134liftCallCC :: proxy tag -> Sig.CallCC m a b -> Sig.CallCC (ReaderT tag r m) a b
129liftCallCC :: proxy tag -> Sig.CallCC m a b -> Sig.CallCC (ReaderT tag r m) a b
135liftCallCC t callCC f = tagged t $ Trans.liftCallCC callCC (coerce f)
130liftCallCC t callCC f = tagged t $ Trans.liftCallCC callCC (coerce f)
@@ -174,4 +169,4 @@ instance Class.MonadWriter w m => Class.MonadWriter w (ReaderT tag r m) where
174
169
175instance Class.MonadError e m => Class.MonadError e (ReaderT tag r m) where
170instance Class.MonadError e m => Class.MonadError e (ReaderT tag r m) where
176 throwError = lift . Class.throwError
171 throwError = lift . Class.throwError
177− catchError = liftCatch Proxy Class.catchError
172+ catchError = Lift.liftCatch Class.catchError
src/Control/Monad/Trans/Ether/State/Lazy.hs+1−6
@@ -27,7 +27,6 @@ module Control.Monad.Trans.Ether.State.Lazy
27 , get
27 , get
28 , put
28 , put
29 -- * Litfing other operations
29 -- * Litfing other operations
30− , liftCatch
31 , liftCallCC'
30 , liftCallCC'
32 , liftListen
31 , liftListen
33 , liftPass
32 , liftPass
@@ -146,10 +145,6 @@ get t = tagged t Trans.get
146put :: Monad m => proxy tag -> s -> StateT tag s m ()
145put :: Monad m => proxy tag -> s -> StateT tag s m ()
147put t = tagged t . Trans.put
146put t = tagged t . Trans.put
148
147
149−-- | Lift a @catchE@ operation to the new monad.
150−liftCatch :: proxy tag -> Sig.Catch e m (a, s) -> Sig.Catch e (StateT tag s m) a
151−liftCatch t f m h = tagged t $ Trans.liftCatch f (coerce m) (coerce h)
152−
153-- | Lift a @listen@ operation to the new monad.
148-- | Lift a @listen@ operation to the new monad.
154liftListen :: Monad m => proxy tag -> Sig.Listen w m (a, s) -> Sig.Listen w (StateT tag s m) a
149liftListen :: Monad m => proxy tag -> Sig.Listen w m (a, s) -> Sig.Listen w (StateT tag s m) a
155liftListen t listen m = tagged t $ Trans.liftListen listen (coerce m)
150liftListen t listen m = tagged t $ Trans.liftListen listen (coerce m)
@@ -187,4 +182,4 @@ instance Class.MonadWriter w m => Class.MonadWriter w (StateT tag s m) where
187
182
188instance Class.MonadError e m => Class.MonadError e (StateT tag s m) where
183instance Class.MonadError e m => Class.MonadError e (StateT tag s m) where
189 throwError = lift . Class.throwError
184 throwError = lift . Class.throwError
190− catchError = liftCatch Proxy Class.catchError
185+ catchError = Lift.liftCatch Class.catchError
src/Control/Monad/Trans/Ether/State/Strict.hs+1−6
@@ -27,7 +27,6 @@ module Control.Monad.Trans.Ether.State.Strict
27 , get
27 , get
28 , put
28 , put
29 -- * Litfing other operations
29 -- * Litfing other operations
30− , liftCatch
31 , liftCallCC'
30 , liftCallCC'
32 , liftListen
31 , liftListen
33 , liftPass
32 , liftPass
@@ -146,10 +145,6 @@ get t = tagged t Trans.get
146put :: Monad m => proxy tag -> s -> StateT tag s m ()
145put :: Monad m => proxy tag -> s -> StateT tag s m ()
147put t = tagged t . Trans.put
146put t = tagged t . Trans.put
148
147
149−-- | Lift a @catchE@ operation to the new monad.
150−liftCatch :: proxy tag -> Sig.Catch e m (a, s) -> Sig.Catch e (StateT tag s m) a
151−liftCatch t f m h = tagged t $ Trans.liftCatch f (coerce m) (coerce h)
152−
153-- | Lift a @listen@ operation to the new monad.
148-- | Lift a @listen@ operation to the new monad.
154liftListen :: Monad m => proxy tag -> Sig.Listen w m (a, s) -> Sig.Listen w (StateT tag s m) a
149liftListen :: Monad m => proxy tag -> Sig.Listen w m (a, s) -> Sig.Listen w (StateT tag s m) a
155liftListen t listen m = tagged t $ Trans.liftListen listen (coerce m)
150liftListen t listen m = tagged t $ Trans.liftListen listen (coerce m)
@@ -187,4 +182,4 @@ instance Class.MonadWriter w m => Class.MonadWriter w (StateT tag s m) where
187
182
188instance Class.MonadError e m => Class.MonadError e (StateT tag s m) where
183instance Class.MonadError e m => Class.MonadError e (StateT tag s m) where
189 throwError = lift . Class.throwError
184 throwError = lift . Class.throwError
190− catchError = liftCatch Proxy Class.catchError
185+ catchError = Lift.liftCatch Class.catchError
src/Control/Monad/Trans/Ether/Writer.hs+1−6
@@ -28,7 +28,6 @@ module Control.Monad.Trans.Ether.Writer
28 , pass
28 , pass
29 -- * Lifting other operations
29 -- * Lifting other operations
30 , liftCallCC
30 , liftCallCC
31− , liftCatch
32 , liftListen
31 , liftListen
33 , liftPass
32 , liftPass
34 ) where
33 ) where
@@ -145,10 +144,6 @@ listen t m = tagged t $ Trans.listen (coerce m)
145pass :: (Monoid w, Monad m) => proxy tag -> WriterT tag w m (a, w -> w) -> WriterT tag w m a
144pass :: (Monoid w, Monad m) => proxy tag -> WriterT tag w m (a, w -> w) -> WriterT tag w m a
146pass t m = tagged t $ Trans.pass (coerce m)
145pass t m = tagged t $ Trans.pass (coerce m)
147
146
148−-- | Lift a @catchE@ operation to the new monad.
149−liftCatch :: proxy tag -> Sig.Catch e m (a, w) -> Sig.Catch e (WriterT tag w m) a
150−liftCatch t f m h = tagged t $ Trans.liftCatch f (coerce m) (coerce h)
151−
152-- | Lift a @callCC@ operation to the new monad.
147-- | Lift a @callCC@ operation to the new monad.
153liftCallCC :: Monoid w => proxy tag -> Sig.CallCC m (a, w) (b, w) -> Sig.CallCC (WriterT tag w m) a b
148liftCallCC :: Monoid w => proxy tag -> Sig.CallCC m (a, w) (b, w) -> Sig.CallCC (WriterT tag w m) a b
154liftCallCC t callCC f = tagged t $ Trans.liftCallCC callCC (coerce f)
149liftCallCC t callCC f = tagged t $ Trans.liftCallCC callCC (coerce f)
@@ -182,4 +177,4 @@ instance (Monoid w, Class.MonadWriter w' m) => Class.MonadWriter w' (WriterT tag
182
177
183instance (Monoid w, Class.MonadError e m) => Class.MonadError e (WriterT tag w m) where
178instance (Monoid w, Class.MonadError e m) => Class.MonadError e (WriterT tag w m) where
184 throwError = lift . Class.throwError
179 throwError = lift . Class.throwError
185− catchError = liftCatch Proxy Class.catchError
180+ catchError = Lift.liftCatch Class.catchError