Commit 576078a8 authored by taylorfausak's avatar taylorfausak Committed by Ben Gamari

base: Improve zip documentation

parent 9969863a
......@@ -947,12 +947,19 @@ foldr2_left k _z x r (y:ys) = k x y (r ys)
----------------------------------------------
-- | 'zip' takes two lists and returns a list of corresponding pairs.
--
-- > zip [1, 2] ['a', 'b'] = [(1, 'a'), (2, 'b')]
--
-- If one input list is short, excess elements of the longer list are
-- discarded.
-- discarded:
--
-- > zip [1] ['a', 'b'] = [(1, 'a')]
-- > zip [1, 2] ['a'] = [(1, 'a')]
--
-- 'zip' is right-lazy:
--
-- > zip [] _|_ = []
-- > zip _|_ [] = _|_
{-# NOINLINE [1] zip #-}
zip :: [a] -> [b] -> [(a,b)]
zip [] _bs = []
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment