Library function to compose a function with itself n times

The iterate solution is fine, or you might like this one: the composition of n copies of f is foldr (.) id (replicate n f).

Leave a Comment