[Haskell-beginners] Does this function already exist in one of the standard modules?

I. J. Kennedy jack at realmode.com
Sat Aug 8 16:01:34 EDT 2009


Does this function already exist in one of the standard modules?
It computes  f(f(f(...f(x))).  I suspect it is a common function, but I
can't find it, even using Hoogle.

  applyMany :: Int -> (a -> a) -> a -> a
  applyMany 0 f x = x
  applyMany n f x = applyMany (n-1) f (f x)


More information about the Beginners mailing list