list-t 0.4.1 → 0.4.2
raw patch · 2 files changed
+16/−4 lines, 2 filesdep ~monad-control
Dependency ranges changed: monad-control
Files
- library/ListT.hs +14/−2
- list-t.cabal +2/−2
library/ListT.hs view
@@ -1,4 +1,4 @@-{-# LANGUAGE UndecidableInstances #-}+{-# LANGUAGE UndecidableInstances, CPP #-} module ListT ( ListT,@@ -125,6 +125,7 @@ liftBase = lift . liftBase +#if MIN_VERSION_monad_control(1,0,0) instance MonadBaseControl b m => MonadBaseControl b (ListT m) where type StM (ListT m) a = StM m (Maybe (a, ListT m a))@@ -135,7 +136,18 @@ lift (restoreM inner) >>= \case Nothing -> mzero Just (h, t) -> cons h t-+#else+instance MonadBaseControl b m => MonadBaseControl b (ListT m) where+ newtype StM (ListT m) a =+ StM (StM m (Maybe (a, ListT m a)))+ liftBaseWith runToBase =+ lift $ liftBaseWith $ \runInner -> + runToBase $ liftM StM . runInner . uncons+ restoreM (StM inner) =+ lift (restoreM inner) >>= \case+ Nothing -> mzero+ Just (h, t) -> cons h t+#endif -- * Classes -------------------------
list-t.cabal view
@@ -1,7 +1,7 @@ name: list-t version:- 0.4.1+ 0.4.2 synopsis: ListT done right description:@@ -44,7 +44,7 @@ ListT build-depends: mmorph == 1.0.*,- monad-control == 1.0.*,+ monad-control >= 0.3 && < 1.1, transformers-base == 0.4.*, transformers >= 0.2 && < 0.5, base-prelude == 0.1.*