Skip to content

Instantly share code, notes, and snippets.

@dgfitch
Created November 22, 2010 20:01
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 dgfitch/710566 to your computer and use it in GitHub Desktop.
Save dgfitch/710566 to your computer and use it in GitHub Desktop.
let rec union l1 l2 =
match l2 with
| [] -> l1
| x :: xs ->
if memb x l1 then
union l1 xs
else
union (x::l1) xs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment