From 90d701887a1155e7b2de86935cb438113c3c8f4f Mon Sep 17 00:00:00 2001 From: Michael Orlitzky Date: Thu, 26 Dec 2013 15:23:36 -0500 Subject: [PATCH] Add Uncurry.hs. --- src/Uncurry.hs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 src/Uncurry.hs diff --git a/src/Uncurry.hs b/src/Uncurry.hs new file mode 100644 index 0000000..f06b3b8 --- /dev/null +++ b/src/Uncurry.hs @@ -0,0 +1,15 @@ +module Uncurry +where + + +uncurry3 :: (a -> b -> c -> d) -> ((a,b,c) -> d) +uncurry3 f = \(x,y,z) -> f x y z + +uncurry4 :: (a -> b -> c -> d -> e) -> ((a,b,c,d) -> e) +uncurry4 f = \(w,x,y,z) -> f w x y z + +uncurry5 :: (a -> b -> c -> d -> e -> f) -> ((a,b,c,d,e) -> f) +uncurry5 f = \(v,w,x,y,z) -> f v w x y z + +uncurry6 :: (a -> b -> c -> d -> e -> f -> g) -> ((a,b,c,d,e,f) -> g) +uncurry6 f = \(u,v,w,x,y,z) -> f u v w x y z -- 2.44.2