haskell - Altered compose function -
i wondering while f. provide example how should running function? (note: understand (.) function composition , know function composition if)
-- compose function n >= 0 times composen :: int -> (a -> a) -> (a -> a) composen 0 f = id composen n f = f . (composen (n-1) f)
f
arbitrary function, provided user. supply composen
succ
, increment integer, , have composed 3 times , applied 2, thereby adding 3:
ghci> composen 3 succ 2 5
Comments
Post a Comment