Advertisement
Guest User

Untitled

a guest
Mar 27th, 2017
327
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
OCaml 0.37 KB | None | 0 0
  1. (*THIS WORKS*)
  2. module type Comparable = sig
  3.   type t
  4.  
  5.   val compare : t -> t -> int
  6. end
  7.  
  8. module  Comparable = struct
  9.   type t = string
  10.  
  11.   let compare = String.compare
  12.  
  13. end
  14.  
  15. module M = Map.Make(Comparable)
  16.  
  17.  
  18.  
  19.  
  20.  
  21. (*THIS DOES NOT WORK ->>*)
  22.  
  23. module type Comparable = sig
  24.   type t
  25.  
  26.   val compare : t -> t -> int
  27. end
  28.  
  29. module M = Map.Make(T : Comparable)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement