SOE ex.5.4

{-

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
-}

Leave a Reply