X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Fcompiler%2Ftests%2FdeSugar%2Fds005.hs;fp=ghc%2Fcompiler%2Ftests%2FdeSugar%2Fds005.hs;h=505d500e3f640728e2e7c9c60f386fbc3effc8eb;hb=e7d21ee4f8ac907665a7e170c71d59e13a01da09;hp=0000000000000000000000000000000000000000;hpb=e48474bff05e6cfb506660420f025f694c870d38;p=ghc-hetmet.git diff --git a/ghc/compiler/tests/deSugar/ds005.hs b/ghc/compiler/tests/deSugar/ds005.hs new file mode 100644 index 0000000..505d500 --- /dev/null +++ b/ghc/compiler/tests/deSugar/ds005.hs @@ -0,0 +1,15 @@ +--!!! ds005 -- mappairs from SLPJ Ch 5' +-- +-- this simply tests a "typical" example + +module MapPairs where + +-- from SLPJ, p 78 +mappairs f [] ys = [] +mappairs f (x:xs) [] = [] +mappairs f (x:xs) (y:ys) = f x y : mappairs f xs ys + +-- from p 80 +mappairs' f [] ys = [] +mappairs' f x [] = [] +mappairs' f (x:xs) (y:ys) = f x y : mappairs' f xs ys