Skip to content

Instantly share code, notes, and snippets.

@simonmichael
Forked from anonymous/gist:779022
Created January 14, 2011 02:00
Show Gist options
  • Save simonmichael/779023 to your computer and use it in GitHub Desktop.
Save simonmichael/779023 to your computer and use it in GitHub Desktop.
-- | Apply a function the specified number of times.
applyN :: Int -> (a -> a) -> a -> a
applyN n f = (!! n) . iterate f
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment