Created
January 28, 2015 05:07
-
-
Save khzaw/80d6764ede0ea4debf10 to your computer and use it in GitHub Desktop.
Remove duplicates from a polymorphic list
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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