Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- open Sexplib
- open Sexplib.Std
- module type Tish = sig
- type a
- end
- module MakeAst (T : Tish) = struct
- type a = T.a
- type t =
- | Int of (a * int)
- | Add of (a * t * t)
- end
- module Pass = struct
- type t
- type a =
- | Unknown
- | Variable of t
- end
- module AstPass = MakeAst(Pass)
- let x = AstPass.Int (Unknown, 20)
- let y = AstPass.Int (Variable (Int (Unknown, 24)), 24)
- (* Error: Unbound constructor Int *)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement