{-
f1 (f2 (*) [1,2,3,4]) 5 = [5,10,15,20]
if (f2 = map) then: f2 (*) [1,2,3,4] = [(*1), (*2), (*3), (*4)]
now, looking for: f1 [(*1), (*2), (*3), (*4)] 5 = [5, 10, 15, 20]
I came out with … (see below)
At least, it gives the right result,
but maybe there is a better simple solution …
-}
result = (\l v -> map (\f -> f v) l) (map (*) [1,2,3,4]) 5
{-
so,
f1 = (\l v -> map (\f -> f v) l)
f2 = map
-}
This entry was posted
on Monday, May 21st, 2007 at 5:11 pm and is filed under Haskell - SOE.
You can follow any responses to this entry through the RSS 2.0 feed.
You can leave a response, or trackback from your own site.