Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (* ------------------------------------------------------------------------- *)
- (* Polymorphic finite partial functions via Patricia trees. *)
- (* *)
- (* The point of this strange representation is that it is canonical (equal *)
- (* functions have the same encoding) yet reasonably efficient on average. *)
- (* *)
- (* Idea due to Diego Olivier Fernandez Pons (OCaml list, 2003/11/10). *)
- (* ------------------------------------------------------------------------- *)
- type ('a,'b)func =
- Empty
- | Leaf of int * ('a*'b)list
- | Branch of int * int * ('a,'b)func * ('a,'b)func;;
Add Comment
Please, Sign In to add comment