[project @ 1996-01-08 20:28:12 by partain]
[ghc-hetmet.git] / ghc / compiler / tests / deSugar / ds005.hs
1 --!!! ds005 -- mappairs from SLPJ Ch 5'
2 --
3 -- this simply tests a "typical" example
4
5 module MapPairs where
6
7 -- from SLPJ, p 78
8 mappairs f []     ys     = []
9 mappairs f (x:xs) []     = []
10 mappairs f (x:xs) (y:ys) = f x y : mappairs f xs ys
11
12 -- from p 80
13 mappairs' f []     ys     = []
14 mappairs' f x      []     = []
15 mappairs' f (x:xs) (y:ys) = f x y : mappairs' f xs ys