Skip to content

Instantly share code, notes, and snippets.

@khzaw
Created January 28, 2015 05:07
Show Gist options
  • Save khzaw/80d6764ede0ea4debf10 to your computer and use it in GitHub Desktop.
Save khzaw/80d6764ede0ea4debf10 to your computer and use it in GitHub Desktop.
Remove duplicates from a polymorphic list
let rec removeDupl (xs:'a list) : 'a list -> match xs with
| [] -> []
| hd::tl -> hd :: (removeDupl (List.filter (fun x -> x <> hd ) tl));;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment