Browse thread
[Caml-list] Polymorphic variants
[
Home
]
[ Index:
by date
|
by threads
]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
| Date: | -- (:) |
| From: | Jerome Vouillon <vouillon@p...> |
| Subject: | Re: [Caml-list] How to compare recursive types? |
On Wed, Apr 24, 2002 at 04:55:29PM +1000, John Max Skaller wrote: > How to compare recursive types? You should definitively read "Recursive Subtyping Revealed" by Vladimir Gapeyev, Michael Levin, and Benjamin Pierce. (Available from http://www.cis.upenn.edu/~bcpierce/papers/index.html) If you are only interested in equality, you can use the same algorithm as for subtyping (equality is a preorder). The complexity of this algorithm can be improved from quadratic to (almost) linear by exploiting the fact that type equality is an equivalence relation: the algorithm uses a set of pairs of already encountered types, but you can use a union-find datastructure instead. -- Jerome ------------------- To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ Beginner's list: http://groups.yahoo.com/group/ocaml_beginners