diff options
author | Xavier Clerc <xavier.clerc@inria.fr> | 2010-04-07 13:01:29 +0000 |
---|---|---|
committer | Xavier Clerc <xavier.clerc@inria.fr> | 2010-04-07 13:01:29 +0000 |
commit | da7c5685f9de943f0cb3647752005b3b7bde48cd (patch) | |
tree | 941e03f9281f999355141d8e82f329fe3f7350ff /test | |
parent | c9c43824898c986248bad4a27647210d9e7b151b (diff) | |
download | ocaml-da7c5685f9de943f0cb3647752005b3b7bde48cd.tar.gz |
Tests moved to 'typing-typeparam'
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@10244 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
Diffstat (limited to 'test')
-rw-r--r-- | test/newtype.ml | 31 |
1 files changed, 0 insertions, 31 deletions
diff --git a/test/newtype.ml b/test/newtype.ml deleted file mode 100644 index 451e0fa3e8..0000000000 --- a/test/newtype.ml +++ /dev/null @@ -1,31 +0,0 @@ -let property = - let new type t in - fun () -> - let module M = struct exception E of t end in - (fun x -> M.E x), (function M.E x -> Some x | _ -> None) - -let () = - let (int_inj, int_proj) = property () in - let (string_inj, string_proj) = property () in - - let i = int_inj 3 in - let s = string_inj "abc" in - - Printf.printf "%b\n%!" (int_proj i = None); - Printf.printf "%b\n%!" (int_proj s = None); - Printf.printf "%b\n%!" (string_proj i = None); - Printf.printf "%b\n%!" (string_proj s = None) - - - - -let sort_uniq = - let new type s in - fun cmp l -> - let module S = Set.Make(struct type t = s let compare = cmp end) in - S.elements (List.fold_right S.add l S.empty) - -let () = - print_endline (String.concat "," (sort_uniq compare [ "abc"; "xyz"; "abc" ])) - - |