Mercurial > urweb
diff src/union_find_fn.sml @ 2219:ff38b3e0cdfd
Add interface to UnionFind.
author | Ziv Scully <ziv@mit.edu> |
---|---|
date | Mon, 24 Nov 2014 20:41:24 -0500 |
parents | 70ec9bb337be |
children | 0730e217fc9c |
line wrap: on
line diff
--- a/src/union_find_fn.sml Tue Nov 11 04:25:20 2014 -0500 +++ b/src/union_find_fn.sml Mon Nov 24 20:41:24 2014 -0500 @@ -1,4 +1,10 @@ -functor UnionFindFn(K : ORD_KEY) = struct +functor UnionFindFn(K : ORD_KEY) :> sig + type unionFind + val empty : unionFind + val union : unionFind * K.ord_key * K.ord_key -> unionFind + val union' : (K.ord_key * K.ord_key) * unionFind -> unionFind + val classes : unionFind -> K.ord_key list list +end = struct structure M = BinaryMapFn(K) structure S = BinarySetFn(K)