Import Upstream version 20180207
[hcoop/debian/mlton.git] / lib / mlton / set / poly-set.sig
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 POLY_SET =
9 sig
10 structure I: INTEGER
11
12 type 'a t
13
14 val empty: {equal: 'a * 'a -> bool,
15 output: 'a * Out.t -> unit} -> 'a t
16
17 val size: 'a t -> I.t
18 val foreach: 'a t * ('a -> unit) -> unit
19 val forall: 'a t * ('a -> bool) -> bool
20 val exists: 'a t * ('a -> bool) -> bool
21 val equals: 'a t * 'a t -> bool
22 val <: 'a t * 'a t -> bool
23 val <=: 'a t * 'a t -> bool
24 val >: 'a t * 'a t -> bool
25 val >=: 'a t * 'a t -> bool
26
27 val +: 'a t * 'a t -> 'a t
28 val -: 'a t * 'a t -> 'a t
29 val intersect: 'a t * 'a t -> 'a t
30
31 (* val union: 'a t list -> 'a t*)
32 val subset: 'a t * ('a -> bool) -> 'a t
33
34 val add: 'a t * 'a -> 'a t
35 val remove: 'a t * 'a -> 'a t
36
37 val contains: 'a t * 'a -> bool
38 val isEmpty: 'a t -> bool
39
40 val toList: 'a t -> 'a list
41
42 val output: 'a t * Out.t -> unit
43 end