Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- open Core.Std
- module T = struct
- type t = int with sexp
- let compare = compare
- let hash = Hashtbl.hash
- end
- include T
- let counter = ref 1
- let reset () = counter := 1
- let create () =
- let t = !counter in
- let () = counter := !counter + 1 in
- t
- let name t = "%t" ^ string_of_int t
- let compare a b = compare a b
- let format ff t = Format.fprintf ff "%s" (name t)
- include Comparable.Make(T)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement