Import Upstream version 20180207
[hcoop/debian/mlton.git] / lib / mlton / basic / rdb.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 (* Relational Data Base *)
10 signature RDB =
11 sig
12 structure Value:
13 sig
14 type t
15
16 val bool: bool -> t
17 val compare: t * t -> Relation.t
18 val int: int -> t
19 val real: real -> t
20 val string: string -> t
21 val toString: t -> string
22 end
23 structure Domain:
24 sig
25 type t
26
27 val bool: t
28 val int: t
29 val real: t
30 val string: t
31 end
32 structure Attribute:
33 sig
34 type t
35
36 val new: string -> t
37 end
38
39 type t
40
41 val add: t * (Attribute.t * Value.t) list -> unit
42 val cardinality: t -> int
43 val degree: t -> int
44 val new: {heading: (Attribute.t * Domain.t) list} -> t
45 val printTable: {rdb: t,
46 row: Attribute.t,
47 col: Attribute.t,
48 entry: Attribute.t,
49 out: Out.t} -> unit
50 val printTable': {rdb: t,
51 cols: Attribute.t list,
52 sortBy: Attribute.t,
53 out: Out.t} -> unit
54 end