Skip to content

Instantly share code, notes, and snippets.

@TheSeamau5
Created December 29, 2014 15:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save TheSeamau5/0033af42fab27ac34e07 to your computer and use it in GitHub Desktop.
Save TheSeamau5/0033af42fab27ac34e07 to your computer and use it in GitHub Desktop.
Function to perform a given operation a given number of times
compute : Int -> (a -> a) -> a -> a
compute iterations function argument =
if (iterations <= 0) then argument
else compute (iterations - 1) function (function argument)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment