Advertisement
Guest User

ocaml error

a guest
Jun 23rd, 2015
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
OCaml 0.40 KB | None | 0 0
  1. let uniq x =
  2.     let (acc : 'a list) = [] in
  3.     let h (a : 'a list) (l : 'a list) = match l with
  4.         |[] -> a
  5.         |hd::[] ->
  6.             (if index a hd = -1 then
  7.                 a
  8.             else
  9.                 a::hd
  10.             )
  11.         |hd::tl ->
  12.             (if index a hd = -1 then
  13.                 a
  14.             else
  15.                 h a::hd tl
  16.             )
  17.     in
  18.     h acc x
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement