Advertisement
Guest User

Untitled

a guest
Jun 8th, 2016
160
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 KB | None | 0 0
  1. module type Session_base = sig
  2. type t
  3. type a
  4. val mk_base : a -> t
  5. end;;
  6.  
  7. module Protocol_base : Session_base = struct
  8. type t = protocol_base_formula
  9. type a = string
  10. let mk_base sender receiver formula = {...}
  11. end;;
  12.  
  13. module Make_Session (Base: Session_base) = struct
  14. type t = Base.t
  15.  
  16. type session =
  17. | SSeq of ...
  18. | SBase of t
  19.  
  20. let mk_base f d e = SBase (Base.mk_base f d e)
  21. end;;
  22.  
  23. module Protocol = Make_Session(Protocol_base);;
  24.  
  25. Call site: Session.Protocol.mk_base first second c
  26. where first is a string
  27.  
  28. Error:
  29. This expression has type string but an expression was expected of type
  30. Session.Protocol_base.a
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement