ZipFold-0.1: Zipping folds

Stabilityexperimental
Maintainerconal@conal.net

Data.Zip.FoldL

Description

Zipping of non-strict left folds.

See http://conal.net/blog/tag/zip. Inspired by Beautiful Folds by Max Rabkin http://squing.blogspot.com/2008/11/beautiful-folding.html

Synopsis

Documentation

data Fold b a Source

Data representation of a left fold

Constructors

F (a -> b -> a) a 

Instances

Zip (Fold b) 
Zip' (Fold b) 

cfoldl :: Fold b a -> [b] -> aSource

Interpretation of a Fold as non-strict

cfoldl' :: Fold b a -> [b] -> aSource

Interpretation of a Fold as non-strict

data WithCont h b c Source

Add a continuation.

Instances

Functor (WithCont h b) 
Zip (h b) => Applicative (WithCont h b) 

type FoldC = WithCont FoldSource

Non-strict left fold with continuation.

cfoldlc :: FoldC b a -> [b] -> aSource

Interpretation of a FoldC

data WithCont' h b c Source

Like WithCont but with pair-strict '(*)'

Instances

Functor (WithCont' h b) 
Zip' (h b) => Applicative (WithCont' h b) 

type FoldC' = WithCont' FoldSource

Strict left fold with continuation.

cfoldlc' :: FoldC' b a -> [b] -> aSource

Interpretation of a FoldC

class Zip' f whereSource

Strict generalized zip

Methods

zip' :: f a -> f b -> f (P a b)Source

Instances

Zip' [] 
Zip' IO 
Zip' ((->) u) 
Monoid u => Zip' ((,) u) 
Zip' (Fold b) 

data P c c' Source

Strict pairs