on develop help sign in
Add MonadPostpone instances for ReaderT and WriterT
commitd7e1f98aeb186a38622378a0d4a30612c5d6034c authorDoug Beardsley <mightybyte@gmail.com> dateWed 15 Mar 2017, 16:05 (10 years ago) parentbd8077e
1 file changed+11
src/Reflex/Postpone/Class.hs+11
src/Reflex/Postpone/Class.hs+11
@@ -1,6 +1,17 @@
11module Reflex.Postpone.Class where
22
3+import Control.Monad.Trans.Control
4+import Control.Monad.Trans.Reader
5+import Control.Monad.Trans.Writer
6+
37class Monad m => MonadPostpone m where
48 -- | Postpone an action until all containing 'mfix'es can be expected to have
59 -- finished executing
610 postpone :: m a -> m a
11+
12+instance MonadPostpone m => MonadPostpone (ReaderT r m) where
13+ postpone = liftThrough postpone
14+
15+instance (MonadPostpone m, Monoid w) => MonadPostpone (WriterT w m) where
16+ postpone = liftThrough postpone
17+