@@ -1,5 +1,10 @@
1{-# LANGUAGE CPP #-}
1{-# LANGUAGE CPP #-}
3+#if __GLASGOW_HASKELL__ < 710
4+{-# LANGUAGE OverlappingInstances #-}
5+{-# OPTIONS_GHC -fno-warn-unrecognised-pragmas #-}
3#if __GLASGOW_HASKELL__ >= 710
8#if __GLASGOW_HASKELL__ >= 710
4{-# OPTIONS_GHC -fno-warn-unticked-promoted-constructors #-}
9{-# OPTIONS_GHC -fno-warn-unticked-promoted-constructors #-}
@@ -84,6 +89,7 @@ import Control.Monad.Ether.State.Class
84import Control.Monad.Ether.Except.Class
89import Control.Monad.Ether.Except.Class
85import Control.Monad.Ether.Writer.Class
90import Control.Monad.Ether.Writer.Class
92+import qualified Control.Monad.Cont as Class
87import qualified Control.Monad.Reader as Class
93import qualified Control.Monad.Reader as Class
88import qualified Control.Monad.State as Class
94import qualified Control.Monad.State as Class
89import qualified Control.Monad.Except as Class
95import qualified Control.Monad.Except as Class
@@ -207,3 +213,44 @@ instance MonadWriter tNew w m
207 tell _ = let t = Proxy :: Proxy tNew in Lift.lift . tell t
213 tell _ = let t = Proxy :: Proxy tNew in Lift.lift . tell t
208 listen _ = let t = Proxy :: Proxy tNew in Lift.liftListen (listen t)
214 listen _ = let t = Proxy :: Proxy tNew in Lift.liftListen (listen t)
209 pass _ = let t = Proxy :: Proxy tNew in Lift.liftPass (pass t)
215 pass _ = let t = Proxy :: Proxy tNew in Lift.liftPass (pass t)
218+-- Instances for mtl classes
220+instance {-# OVERLAPPABLE #-}
222+ ) => Class.MonadCont (DispatchT dp m)
224+ callCC = Lift.liftCallCC' Class.callCC
226+instance {-# OVERLAPPABLE #-}
227+ ( Class.MonadReader r m
228+ ) => Class.MonadReader r (DispatchT dp m)
230+ ask = Class.lift Class.ask
231+ local = Lift.liftLocal Class.ask Class.local
232+ reader = Class.lift . Class.reader
234+instance {-# OVERLAPPABLE #-}
235+ ( Class.MonadState s m
236+ ) => Class.MonadState s (DispatchT dp m)
238+ get = Class.lift Class.get
239+ put = Class.lift . Class.put
240+ state = Class.lift . Class.state
242+instance {-# OVERLAPPABLE #-}
243+ ( Class.MonadWriter w m
244+ ) => Class.MonadWriter w (DispatchT dp m)
246+ writer = Class.lift . Class.writer
247+ tell = Class.lift . Class.tell
248+ listen = Lift.liftListen Class.listen
249+ pass = Lift.liftPass Class.pass
251+instance {-# OVERLAPPABLE #-}
252+ ( Class.MonadError e m
253+ ) => Class.MonadError e (DispatchT dp m)
255+ throwError = Class.lift . Class.throwError
256+ catchError = Lift.liftCatch Class.catchError