]> Git — Sourcephile - tmp/julm/arpeggigon.git/blob - src/RMCA/Auxiliary/Curry.hs
Better note selection.
[tmp/julm/arpeggigon.git] / src / RMCA / Auxiliary / Curry.hs
1 -- Contains function to currify/uncurrify functions with more than
2 -- two arguments. It might be useful to use Template Haskell there.
3
4 module RMCA.Auxiliary.Curry where
5
6 curry3 :: ((a,b,c) -> d) -> a -> b -> c -> d
7 curry3 f a b c = f (a,b,c)
8
9 uncurry3 :: (a -> b -> c -> d) -> (a,b,c) -> d
10 uncurry3 f (a,b,c) = f a b c
11
12 curry4 :: ((a,b,c,d) -> e) -> a -> b -> c -> d -> e
13 curry4 f a b c d = f (a,b,c,d)
14
15 uncurry4 :: (a -> b -> c -> d -> e) -> (a,b,c,d) -> e
16 uncurry4 f (a,b,c,d) = f a b c d
17
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)
20
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