Advertisement
Guest User

Untitled

a guest
Sep 23rd, 2016
143
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
OCaml 0.37 KB | None | 0 0
  1. open Core.Std
  2.  
  3. exception Bad_id of string
  4.  
  5. module type empty = sig end
  6.  
  7. module type id = sig
  8.     type t
  9.     val of_string : string -> t
  10.     val to_string : t -> string
  11.   end
  12.  
  13. module StrId (E : empty) : id =
  14.   struct
  15.     type t = string
  16.     let of_string x = x
  17.     let to_string x = x
  18.   end
  19.  
  20. module TypeId = StrId (struct end)
  21. module ServiceId = StrId (struct end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement