Advertisement
Guest User

Untitled

a guest
Mar 3rd, 2021
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
OCaml 0.38 KB | None | 0 0
  1. (* base.ml *)
  2. type t = int
  3.  
  4. (* medium.ml *)
  5. type t = Base.t
  6. let _a : t = 42
  7. let b : t = 53
  8.  
  9. (* wrapper.mli *)
  10. type t
  11. module Medium : sig
  12.   val b : t
  13. end
  14. val print_int : t -> unit
  15.  
  16. (* wrapper.ml *)
  17. type t = Base.t
  18. module Medium = struct
  19.   include Medium
  20. end
  21. let print_int : t -> unit = fun n -> Format.printf "%d\n" n
  22.  
  23. (* main.ml *)
  24. let () = Wrapper.(print_int Medium.b)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement