Advertisement
Guest User

Untitled

a guest
Oct 9th, 2017
123
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. module type Format = sig
  2. type fmt
  3. val to_int : fmt -> int
  4. end
  5.  
  6. module type Maker = functor (F : Format) -> sig
  7. type t
  8. val unsafe_b : F.fmt -> string
  9. val unsafe_s : string -> F.fmt
  10. end
  11.  
  12. module FirstFormat =
  13. struct
  14. type fmt = string
  15. let to_int n = 1
  16. end
  17.  
  18. module SecondFormat =
  19. struct
  20. type fmt = string
  21. let to_int n = 2
  22. end
  23.  
  24. module Make (F : Format) = struct
  25. type t = F.fmt
  26. let unsafe_b (b : F.fmt) = b
  27. let unsafe_s (s : string) = s
  28. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement