[Haskell-cafe] Partially applied functions

Casey Hawthorne caseyh at istar.ca
Sat Nov 28 13:22:57 EST 2009


Will the following do what you wish?

add :: Int -> Int -> Int
add x y = x + y

addends = [3,5,7,3,5,8]::[Int]

add3s :: [Int] -> [Int -> Int]
add3s addends = map add (filter (3==) addends)

k3 :: [Int]
k3 = map (\ f -> f 10 ) (add3s addends)
--
Regards,
Casey


More information about the Haskell-Cafe mailing list