Skip to content

Instantly share code, notes, and snippets.

@andrewharmellaw
Last active December 3, 2015 11:08
Show Gist options
  • Save andrewharmellaw/26c550ef747679cfb47b to your computer and use it in GitHub Desktop.
Save andrewharmellaw/26c550ef747679cfb47b to your computer and use it in GitHub Desktop.
length(List (5,6,7))
foldRight(5 :: 6 :: 7 :: Nil, 0) ((_, acc) => acc + 1)
f(5, foldRight(6 :: 7 :: Nil, 0) ((_, acc) => acc + 1))
(foldRight(6 :: 7 :: Nil, 0) ((_, acc) => acc + 1)) + 1
(f(6, foldRight(7 :: Nil, 0)) ((_, acc) => acc + 1))) + 1
((foldRight(7 :: Nil, 0) ((_, acc) => acc + 1)) + 1) + 1
(((0 + 1) + 1) + 1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment