on master help sign in
Do not define custom liftCatch
commit690bc446509e1bbab4235a6b4bd9efc743477cea authorIndex Int <vlad.z.4096@gmail.com> dateThu 18 Jun 2015, 19:02 (11 years ago) parent67ca0b0
4 files changed+4−24
src/Control/Monad/Trans/Ether/Reader.hs+1−6 src/Control/Monad/Trans/Ether/State/Lazy.hs+1−6 src/Control/Monad/Trans/Ether/State/Strict.hs+1−6 src/Control/Monad/Trans/Ether/Writer.hs+1−6
src/Control/Monad/Trans/Ether/Reader.hs+1−6
@@ -24,7 +24,6 @@ module Control.Monad.Trans.Ether.Reader
2424 , ask
2525 , local
2626 -- * Lifting other operations
27− , liftCatch
2827 , liftCallCC
2928 ) where
3029
@@ -126,10 +125,6 @@ withReaderT
126125 -> ReaderT tag r' m a
127126withReaderT t f m = tagged t $ Trans.withReaderT f (coerce m)
128127
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−
133128-- | Lift a @callCC@ operation to the new monad.
134129liftCallCC :: proxy tag -> Sig.CallCC m a b -> Sig.CallCC (ReaderT tag r m) a b
135130liftCallCC 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
174169
175170instance Class.MonadError e m => Class.MonadError e (ReaderT tag r m) where
176171 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
2727 , get
2828 , put
2929 -- * Litfing other operations
30− , liftCatch
3130 , liftCallCC'
3231 , liftListen
3332 , liftPass
@@ -146,10 +145,6 @@ get t = tagged t Trans.get
146145put :: Monad m => proxy tag -> s -> StateT tag s m ()
147146put t = tagged t . Trans.put
148147
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−
153148-- | Lift a @listen@ operation to the new monad.
154149liftListen :: Monad m => proxy tag -> Sig.Listen w m (a, s) -> Sig.Listen w (StateT tag s m) a
155150liftListen 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
187182
188183instance Class.MonadError e m => Class.MonadError e (StateT tag s m) where
189184 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
2727 , get
2828 , put
2929 -- * Litfing other operations
30− , liftCatch
3130 , liftCallCC'
3231 , liftListen
3332 , liftPass
@@ -146,10 +145,6 @@ get t = tagged t Trans.get
146145put :: Monad m => proxy tag -> s -> StateT tag s m ()
147146put t = tagged t . Trans.put
148147
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−
153148-- | Lift a @listen@ operation to the new monad.
154149liftListen :: Monad m => proxy tag -> Sig.Listen w m (a, s) -> Sig.Listen w (StateT tag s m) a
155150liftListen 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
187182
188183instance Class.MonadError e m => Class.MonadError e (StateT tag s m) where
189184 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
2828 , pass
2929 -- * Lifting other operations
3030 , liftCallCC
31− , liftCatch
3231 , liftListen
3332 , liftPass
3433 ) where
@@ -145,10 +144,6 @@ listen t m = tagged t $ Trans.listen (coerce m)
145144pass :: (Monoid w, Monad m) => proxy tag -> WriterT tag w m (a, w -> w) -> WriterT tag w m a
146145pass t m = tagged t $ Trans.pass (coerce m)
147146
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−
152147-- | Lift a @callCC@ operation to the new monad.
153148liftCallCC :: Monoid w => proxy tag -> Sig.CallCC m (a, w) (b, w) -> Sig.CallCC (WriterT tag w m) a b
154149liftCallCC 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
182177
183178instance (Monoid w, Class.MonadError e m) => Class.MonadError e (WriterT tag w m) where
184179 throwError = lift . Class.throwError
185− catchError = liftCatch Proxy Class.catchError
180+ catchError = Lift.liftCatch Class.catchError