daily pastebin goal
24%
SHARE
TWEET

Untitled

a guest Feb 16th, 2019 62 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. module Dom (M : Map.OrderedType) :
  2. sig
  3.   val domain : 'a Map.Make(M).t -> Set.Make(M).t
  4. end =
  5. struct
  6.  
  7.   type 'a map = 'a Map.Make(M).t
  8.   type set = Set.Make(M).t
  9.  
  10.   type 'a _map =
  11.   | MEmpty
  12.   | MNode of 'a map * M.t * 'a * 'a map * int
  13.  
  14.   type _set =
  15.   | SEmpty
  16.   | SNode of set * M.t * set * int
  17.  
  18.   let rec domain (s : 'a map) : set = match Obj.magic s with
  19.   | MEmpty -> Obj.magic SEmpty
  20.   | MNode (l, k, _, r, h) ->
  21.     Obj.magic (SNode (domain l, k, domain r, h))
  22.  
  23. end
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top