1 -- Contains function to currify/uncurrify functions with more than
2 -- two arguments. It might be useful to use Template Haskell there.
4 module RMCA.Auxiliary.Curry where
6 curry3 :: ((a,b,c) -> d) -> a -> b -> c -> d
7 curry3 f a b c = f (a,b,c)
9 uncurry3 :: (a -> b -> c -> d) -> (a,b,c) -> d
10 uncurry3 f (a,b,c) = f a b c
12 curry4 :: ((a,b,c,d) -> e) -> a -> b -> c -> d -> e
13 curry4 f a b c d = f (a,b,c,d)
15 uncurry4 :: (a -> b -> c -> d -> e) -> (a,b,c,d) -> e
16 uncurry4 f (a,b,c,d) = f a b c d
18 curry5 :: ((a,b,c,d,e) -> f) -> a -> b -> c -> d -> e -> f
19 curry5 f a b c d e = f (a,b,c,d,e)
21 uncurry5 :: (a -> b -> c -> d -> e -> f) -> (a,b,c,d,e) -> f
22 uncurry5 f (a,b,c,d,e) = f a b c d e