Import Debian changes 20180207-1
[hcoop/debian/mlton.git] / mlton / atoms / hash-type.sig
1 (* Copyright (C) 1999-2007 Henry Cejtin, Matthew Fluet, Suresh
2 * Jagannathan, and Stephen Weeks.
3 * Copyright (C) 1997-2000 NEC Research Institute.
4 *
5 * MLton is released under a BSD-style license.
6 * See the file MLton-LICENSE for details.
7 *)
8
9 signature HASH_TYPE_STRUCTS =
10 sig
11 include ATOMS
12 end
13
14 signature HASH_TYPE =
15 sig
16 include HASH_TYPE_STRUCTS
17 include TYPE_OPS
18 sharing type realSize = RealSize.t
19 sharing type tycon = Tycon.t
20 sharing type wordSize = WordSize.t
21
22 structure Dest:
23 sig
24 datatype dest =
25 Con of Tycon.t * t vector
26 | Var of Tyvar.t
27 val dest: t -> dest
28 end
29
30 val checkPrimApp: {args: t vector,
31 prim: t Prim.t,
32 result: t,
33 targs: t vector} -> bool
34 val containsTycon: t * Tycon.t -> bool
35 (* O(1) time *)
36 val equals: t * t -> bool
37 (* for reporting type errors *)
38 val error: string * Layout.t -> 'a
39 val hash: t -> Word.t
40 val hom: {ty: t,
41 var: Tyvar.t -> 'a,
42 con: Tycon.t * 'a vector -> 'a} -> 'a
43 val isUnit: t -> bool
44 val layout: t -> Layout.t
45 val layoutPretty: t -> Layout.t
46 val makeHom:
47 {var: t * Tyvar.t -> 'a,
48 con: t * Tycon.t * 'a vector -> 'a}
49 -> {hom: t -> 'a,
50 destroy: unit -> unit}
51 val makeMonoHom:
52 {con: t * Tycon.t * 'a vector -> 'a}
53 -> {hom: t -> 'a,
54 destroy: unit -> unit}
55 val ofConst: Const.t -> t
56 val plist: t -> PropertyList.t
57 val stats: unit -> Layout.t
58 val string: t (* synonym for word8Vector *)
59 (* substitute (t, [(a1, t1), ..., (an, tn)]) performs simultaneous
60 * substitution of the ti for ai in t.
61 * The ai's are not required to contain every free variable in t
62 *)
63 val substitute: t * (Tyvar.t * t) vector -> t
64 val tycon: t -> Tycon.t
65 val var: Tyvar.t -> t
66 end