list-t 1.0.3.1 → 1.0.4
raw patch · 3 files changed
+12/−1 lines, 3 filesdep +foldl
Dependencies added: foldl
Files
- library/ListT.hs +9/−0
- library/ListT/Prelude.hs +1/−0
- list-t.cabal +2/−1
library/ListT.hs view
@@ -9,6 +9,7 @@ null, fold, foldMaybe,+ applyFoldM, toList, toReverseList, traverse_,@@ -191,6 +192,14 @@ (h, t) <- MaybeT $ uncons l r' <- MaybeT $ s r h lift $ foldMaybe s r' t++-- |+-- Apply a left fold abstraction from the \"foldl\" package.+applyFoldM :: Monad m => FoldM m i o -> ListT m i -> m o+applyFoldM (FoldM step init extract) lt = do+ a <- init+ b <- fold step a lt+ extract b -- | -- Execute, folding to a list.
library/ListT/Prelude.hs view
@@ -9,6 +9,7 @@ import Control.Category as Exports import Control.Concurrent as Exports import Control.Exception as Exports+import Control.Foldl as Exports (Fold(..), FoldM(..)) import Control.Monad as Exports hiding (mapM_, sequence_, forM_, msum, mapM, sequence, forM, fail) import Control.Monad.Base as Exports import Control.Monad.Error.Class as Exports
list-t.cabal view
@@ -1,7 +1,7 @@ name: list-t version:- 1.0.3.1+ 1.0.4 synopsis: ListT done right description:@@ -44,6 +44,7 @@ other-modules: ListT.Prelude build-depends:+ foldl >=1 && <2, mmorph == 1.*, monad-control >= 0.3 && < 2, mtl == 2.*,