Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- let uniq x =
- let (acc : 'a list) = [] in
- let h (a : 'a list) (l : 'a list) = match l with
- |[] -> a
- |hd::[] ->
- (if index a hd = -1 then
- a
- else
- a::hd
- )
- |hd::tl ->
- (if index a hd = -1 then
- a
- else
- h a::hd tl
- )
- in
- h acc x
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement