list-zip-def-0.1.0.1: Provides zips where the combining doesn't stop premature, but instead uses default values.

Safe HaskellSafe
LanguageHaskell2010

Data.List.Zip

Synopsis

Documentation

zipDefWith :: a -> b -> (a -> b -> c) -> [a] -> [b] -> [c] Source

Combines all lists by applying the combining function, using the given defaults whenever a list exhaustes until the last list is empty.

For finite lists the following always holds:

length (zipDefWith defX defY f xs ys) == max (length xs) (length ys)

and the missing tail will always be extended with the default value:

drop (length xs) (zipDefWith defX defY f xs ys) == map (f defX) (drop (length xs) ys)

zipDef :: a -> b -> [a] -> [b] -> [(a, b)] Source

Analogous to zip:

zipDef defX defY = zipDefWith defX defY (,)

zipDefWith3 :: a -> b -> c -> (a -> b -> c -> d) -> [a] -> [b] -> [c] -> [d] Source

zipDef3 :: a -> b -> c -> [a] -> [b] -> [c] -> [(a, b, c)] Source

zipDefWith4 :: a -> b -> c -> d -> (a -> b -> c -> d -> e) -> [a] -> [b] -> [c] -> [d] -> [e] Source

zipDef4 :: a -> b -> c -> d -> [a] -> [b] -> [c] -> [d] -> [(a, b, c, d)] Source

zipDefWith5 :: a -> b -> c -> d -> e -> (a -> b -> c -> d -> e -> f) -> [a] -> [b] -> [c] -> [d] -> [e] -> [f] Source

zipDef5 :: a -> b -> c -> d -> e -> [a] -> [b] -> [c] -> [d] -> [e] -> [(a, b, c, d, e)] Source

zipDefWith6 :: a -> b -> c -> d -> e -> f -> (a -> b -> c -> d -> e -> f -> g) -> [a] -> [b] -> [c] -> [d] -> [e] -> [f] -> [g] Source

zipDef6 :: a -> b -> c -> d -> e -> f -> [a] -> [b] -> [c] -> [d] -> [e] -> [f] -> [(a, b, c, d, e, f)] Source

zipDefWith7 :: a -> b -> c -> d -> e -> f -> g -> (a -> b -> c -> d -> e -> f -> g -> h) -> [a] -> [b] -> [c] -> [d] -> [e] -> [f] -> [g] -> [h] Source

zipDef7 :: a -> b -> c -> d -> e -> f -> g -> [a] -> [b] -> [c] -> [d] -> [e] -> [f] -> [g] -> [(a, b, c, d, e, f, g)] Source