Skip to content

Instantly share code, notes, and snippets.

@m1el
Created July 7, 2014 06:45
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 m1el/7b6fff90ab249d8dc5ce to your computer and use it in GitHub Desktop.
Save m1el/7b6fff90ab249d8dc5ce to your computer and use it in GitHub Desktop.
λ let nest f n x = if n <= 0 then x else f (nest f (n-1) x)
λ let pow2 x = x^x
λ nest pow2 3 3
<interactive>: out of memory (requested 1048576 bytes)
λ import Data.List
λ let nest f n x = foldl' (\a _->f a) x [1..n]
λ let pow2 x = x^x
λ nest pow2 3 3
<interactive>: out of memory (requested 1048576 bytes)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment