Commit | Line | Data |
---|---|---|
7f918cf1 CE |
1 | (* Copyright (C) 1999-2006 Henry Cejtin, Matthew Fluet, Suresh |
2 | * Jagannathan, and Stephen Weeks. | |
3 | * | |
4 | * MLton is released under a BSD-style license. | |
5 | * See the file MLton-LICENSE for details. | |
6 | *) | |
7 | ||
8 | signature DISJOINT_SET = | |
9 | sig | |
10 | type 'a t | |
11 | ||
12 | (* Each set is associated with a single value, like a ref cell. *) | |
13 | val := : 'a t * 'a -> unit | |
14 | val ! : 'a t -> 'a | |
15 | ||
16 | val canUnion: 'a t * 'a t * ('a * 'a -> 'a option) -> bool | |
17 | val equals: 'a t * 'a t -> bool | |
18 | val isRepresentative: 'a t -> bool | |
19 | val representative: 'a t -> 'a t | |
20 | val singleton: 'a -> 'a t | |
21 | (* When unions occur, one of the values is chosen. *) | |
22 | val union: 'a t * 'a t -> unit | |
23 | end |