comparison 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
comparison
equal deleted inserted replaced
2218:f7113855f3b7 2219:ff38b3e0cdfd
1 functor UnionFindFn(K : ORD_KEY) = struct 1 functor UnionFindFn(K : ORD_KEY) :> sig
2 type unionFind
3 val empty : unionFind
4 val union : unionFind * K.ord_key * K.ord_key -> unionFind
5 val union' : (K.ord_key * K.ord_key) * unionFind -> unionFind
6 val classes : unionFind -> K.ord_key list list
7 end = struct
2 8
3 structure M = BinaryMapFn(K) 9 structure M = BinaryMapFn(K)
4 structure S = BinarySetFn(K) 10 structure S = BinarySetFn(K)
5 11
6 datatype entry = 12 datatype entry =