Created
November 19, 2012 11:09
-
-
Save VienosNotes/4110148 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 diff xs ys = | |
| let rec internal xs ys ans = | |
| match xs with | |
| | hd::tl -> | |
| if List.mem hd ys then internal tl ys ans | |
| else internal tl ys (ans @ [hd]) | |
| | _ -> ans | |
| in | |
| internal xs ys [];; | |
| diff [1;2;3;4;5;6] [2;4;6];; | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment