Advertisement
Guest User

comparable

a guest
Nov 17th, 2016
141
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
OCaml 0.16 KB | None | 0 0
  1. module Node_cmp = Comparable.Make(struct
  2.     type t = int*float with sexp
  3.     let compare (i1,l1) (i2,l2) =
  4.         if l1 = l2 then i1-i2 else (if l1 > l2 then 1 else -1)
  5.     end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement