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 | functor Set() : | |
9 | sig | |
10 | type 'a t | |
11 | ||
12 | val make: {equal: 'a * 'a -> bool, | |
13 | output: 'a * Out.t -> unit} -> | |
14 | {empty: 'a t, | |
15 | isEmpty: 'a t -> bool, | |
16 | forall: 'a t * ('a -> bool) -> bool, | |
17 | equal: 'a t * 'a t -> bool, | |
18 | ...} | |
19 | end | |
20 | ||
21 | fun make{equal, output} = | |
22 | let | |
23 | val empty = [] | |
24 | fun isEmpty [] = true | |
25 | | isEmpty _ = false | |
26 | val forall = List.forall | |
27 | in {empty = empty, | |
28 | isEmpty = isEmpty, |