diff options
Diffstat (limited to 'ocaml-binary-annot/camlp4/test/fixtures/outside-scope.ml')
| -rw-r--r-- | ocaml-binary-annot/camlp4/test/fixtures/outside-scope.ml | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/ocaml-binary-annot/camlp4/test/fixtures/outside-scope.ml b/ocaml-binary-annot/camlp4/test/fixtures/outside-scope.ml new file mode 100644 index 0000000000..6b8b80b80c --- /dev/null +++ b/ocaml-binary-annot/camlp4/test/fixtures/outside-scope.ml @@ -0,0 +1,21 @@ +type t 'a = [ Nil | Cons of 'a and t 'a ]; + +module A : sig + value app_hd : t 'a -> ('a -> 'a) -> option 'a; +end = struct + value app_hd x f = + match x with + [ Nil -> None + | Cons x _ -> Some (f x) ]; +end; +open A; + +module M = struct + external mk_nil : unit -> t 'a = "%identity"; + value nil = mk_nil (); + (* value is_nil x = x = nil; *) +end; + +(* M.app_hd succ (M.Cons 1 M.Nil); *) +(* M.hd (M.Cons 1 M.Nil); *) +app_hd (M.nil : t 'a) (fun (x : int) -> (x : 'a)); |
