Skip to content

Instantly share code, notes, and snippets.

@rightfold
Last active August 29, 2015 14:06
Show Gist options
  • Save rightfold/6d0d81eae890732340aa to your computer and use it in GitHub Desktop.
Save rightfold/6d0d81eae890732340aa to your computer and use it in GitHub Desktop.
let map f xs (go result = []) =
if empty? xs
then result
else go f (tail xs) (f (head xs) :: result)
// would be equivalent to
let map f' xs' = (
let go f xs result =
if empty? xs
then result
else go f (tail xs) (f (head xs) :: result)
go f' xs' []
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment