Import Upstream version 20180207
[hcoop/debian/mlton.git] / lib / mlton / set / set.sig
1 (* Copyright (C) 2009 Matthew Fluet.
2 * Copyright (C) 1999-2006 Henry Cejtin, Matthew Fluet, Suresh
3 * Jagannathan, and Stephen Weeks.
4 *
5 * MLton is released under a BSD-style license.
6 * See the file MLton-LICENSE for details.
7 *)
8
9 signature SET_STRUCTS =
10 sig
11 structure Element: T
12 end
13
14 signature SET =
15 sig
16 structure Element: T
17
18 type t
19
20 val + : t * t -> t
21 val - : t * t -> t
22 val < : t * t -> bool
23 val <= : t * t -> bool
24 val > : t * t -> bool
25 val >= : t * t -> bool
26 val add: t * Element.t -> t
27 val areDisjoint: t * t -> bool
28 val contains: t * Element.t -> bool
29 val empty: t
30 val equals: t * t -> bool
31 val exists: t * (Element.t -> bool) -> bool
32 val fold: t * 'a * (Element.t * 'a -> 'a) -> 'a
33 val forall: t * (Element.t -> bool) -> bool
34 val foreach: t * (Element.t -> unit) -> unit
35 (* list must contain no duplicates *)
36 val fromList: Element.t list -> t
37 val intersect: t * t -> t
38 val isEmpty: t -> bool
39 val layout: t -> Layout.t
40 val map: t * (Element.t -> Element.t) -> t
41 val partition: t * (Element.t -> bool) -> {yes: t, no: t}
42 val power: t -> t list
43 val replace: t * (Element.t -> Element.t option) -> t
44 val remove: t * Element.t -> t
45 val singleton: Element.t -> t
46 val size: t -> int
47 val subset: t * (Element.t -> bool) -> t
48 val subsets: t * int -> t list
49 val subsetSize: t * (Element.t -> bool) -> int
50 val toList: t -> Element.t list
51 val union: t * t -> t
52 val unions: t list -> t
53 end