Guest User

Untitled

a guest
Feb 18th, 2019
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.72 KB | None | 0 0
  1. module Base =
  2. struct
  3. type server_msg = .. [@@deriving yojson]
  4. type server_msg +=
  5. | SOk of string
  6. [@@deriving yojson]
  7.  
  8. type client_msg = .. [@@deriving yojson]
  9. type client_msg +=
  10. | Push
  11. [@@deriving yojson]
  12. end
  13.  
  14. module Make_base() = struct include Base end
  15.  
  16. module type P =
  17. sig
  18. type app_server_msg = .. [@@deriving yojson]
  19. type app_client_msg = .. [@@deriving yojson]
  20.  
  21. include (module type of Base)
  22.  
  23. val pack_server_msg : string -> server_msg -> app_server_msg
  24. val unpack_server_msg : app_server_msg -> (string * server_msg) option
  25.  
  26. val pack_client_msg : string -> client_msg -> app_client_msg
  27. val unpack_client_msg : app_client_msg -> (string * client_msg) option
  28. end
Add Comment
Please, Sign In to add comment