-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Zipping folds -- -- ZipFold is a small package zipping folds, as described in a collection -- of blog posts, http://conal.net/blog/tag/zip, inspired by a -- post by Max Rabkin -- http://squing.blogspot.com/2008/11/beautiful-folding.html. -- -- Project wiki page: http://haskell.org/haskellwiki/ZipFold -- -- The module documentation pages have links to colorized source code and -- to wiki pages where you can read and contribute user comments. Enjoy! -- -- © 2008 by Conal Elliott; BSD3 license. @package ZipFold @version 0.0 -- | Zipping of non-strict left folds. -- -- Based on Beautiful Folds by Max Rabkin -- http://squing.blogspot.com/2008/11/beautiful-folding.html -- -- See also -- http://conal.net/blog/posts/more-beautiful-fold-zipping module Data.Zip.FoldL -- | Data representation of a left fold data Fold b a F :: (a -> b -> a) -> a -> Fold b a -- | Interpretation of a Fold as non-strict cfoldl :: Fold b a -> [b] -> a -- | Interpretation of a Fold as non-strict cfoldl' :: Fold b a -> [b] -> a -- | Add a continuation. data WithCont h b c -- | Non-strict left fold with continuation. type FoldC = WithCont Fold -- | Interpretation of a FoldC cfoldlc :: FoldC b a -> [b] -> a -- | Like WithCont but with pair-strict '(*)' data WithCont' h b c -- | Strict left fold with continuation. type FoldC' = WithCont' Fold -- | Interpretation of a FoldC cfoldlc' :: FoldC' b a -> [b] -> a -- | Strict generalized pair class Pair' f pair' :: (Pair' f) => f a -> f b -> f (P a b) -- | Strict pairs data P c c' instance Pair' IO instance Pair' ((->) u) instance (Monoid u) => Pair' ((,) u) instance Pair' [] instance (Pair' (h b)) => Applicative (WithCont' h b) instance Functor (WithCont' h b) instance (Pair (h b)) => Applicative (WithCont h b) instance Functor (WithCont h b) instance Pair' (Fold b) instance Pair (Fold b)