list-zip-def-0.1.0.3: Provides zips with default values.

Safe HaskellSafe
LanguageHaskell2010

Data.List.Zip

Synopsis
  • zipDefWith :: a -> b -> (a -> b -> c) -> [a] -> [b] -> [c]
  • zipDef :: a -> b -> [a] -> [b] -> [(a, b)]
  • zipDefWith3 :: a -> b -> c -> (a -> b -> c -> d) -> [a] -> [b] -> [c] -> [d]
  • zipDef3 :: a -> b -> c -> [a] -> [b] -> [c] -> [(a, b, c)]
  • zipDefWith4 :: a -> b -> c -> d -> (a -> b -> c -> d -> e) -> [a] -> [b] -> [c] -> [d] -> [e]
  • zipDef4 :: a -> b -> c -> d -> [a] -> [b] -> [c] -> [d] -> [(a, b, c, d)]
  • zipDefWith5 :: a -> b -> c -> d -> e -> (a -> b -> c -> d -> e -> f) -> [a] -> [b] -> [c] -> [d] -> [e] -> [f]
  • zipDef5 :: a -> b -> c -> d -> e -> [a] -> [b] -> [c] -> [d] -> [e] -> [(a, b, c, d, e)]
  • zipDefWith6 :: a -> b -> c -> d -> e -> f -> (a -> b -> c -> d -> e -> f -> g) -> [a] -> [b] -> [c] -> [d] -> [e] -> [f] -> [g]
  • zipDef6 :: a -> b -> c -> d -> e -> f -> [a] -> [b] -> [c] -> [d] -> [e] -> [f] -> [(a, b, c, d, e, f)]
  • zipDefWith7 :: a -> b -> c -> d -> e -> f -> g -> (a -> b -> c -> d -> e -> f -> g -> h) -> [a] -> [b] -> [c] -> [d] -> [e] -> [f] -> [g] -> [h]
  • zipDef7 :: a -> b -> c -> d -> e -> f -> g -> [a] -> [b] -> [c] -> [d] -> [e] -> [f] -> [g] -> [(a, b, c, d, e, f, g)]

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 is exhausted 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 #