ZipFold-0.1.4: 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 FoldLs by Max Rabkin http://squing.blogspot.com/2008/11/beautiful-folding.html

Synopsis

Documentation

data FoldL b a Source

Data representation of a left fold

Constructors

F (a -> b -> a) a 

Instances

Zip (FoldL b) 
Zip' (FoldL b) 

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

Interpretation of a FoldL as non-strict

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

Interpretation of a FoldL as non-strict

data WithCont z c Source

Add a continuation.

Instances

Functor (WithCont z) 
Zip z => Applicative (WithCont z) 
Zip z => Zip (WithCont z) 
Zip z => Monoidal (WithCont z) 

type FoldLC b = WithCont (FoldL b)Source

Non-strict left fold with continuation.

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

Interpretation of a FoldLC

data WithCont' z c Source

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

Instances

type FoldLC' b = WithCont' (FoldL b)Source

Strict left fold with continuation.

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

Interpretation of a FoldLC

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' (FoldL b) 

data P c c' Source

Strict pairs

Constructors

P !c !c'