Skip to content

Instantly share code, notes, and snippets.

@gian
Created October 7, 2011 15:31
Show Gist options
  • Save gian/1270542 to your computer and use it in GitHub Desktop.
Save gian/1270542 to your computer and use it in GitHub Desktop.
fun ap (h::l) =
let
fun allpairs h [] = []
| allpairs h (h'::t) = (h,h') :: allpairs h t
in
List.foldl (fn (a,b) => b @ allpairs a l) [] (h::l)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment