apply a function to all params of another function

26 May
2014
26 May
'14
10:46 a.m.
In have a lot of functions in a program with params that are alle Int's. f :: Int -> Int -> Int g :: Int -> Int -> Int h :: Int -> Int -> Int -> Int ... and convertParam :: Int -> Int -- say (+1) I want to call functions like f, g and h, but apply convertParam to all params first. f2 a b c = f (convertParam a) (convertParam b) (convertParam c) I tried: run1p f conv = \a -> f (conv a) -- for functions with one param run2p f conv = \a b -> f (conv a) (conv b) -- for functions with two params . Can you do this in a more generalized way (using currying?) Any ideas? Kees
4012
Age (days ago)
4012
Last active (days ago)
0 comments
1 participants
participants (1)
-
Kees Bleijenberg