Skip to content

Instantly share code, notes, and snippets.

@kunishi
Created January 29, 2014 10:20
Show Gist options
  • Save kunishi/8685168 to your computer and use it in GitHub Desktop.
Save kunishi/8685168 to your computer and use it in GitHub Desktop.
exception EmptyList;
fun reduce(F, nil) = raise EmptyList
| reduce(F, [a]) = a
| reduce(F, x::xs) = F(x, reduce(F, xs));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment