Commit | Line | Data |
---|---|---|
7f918cf1 CE |
1 | (* A subset of the UNSAFE signature provided by SML/NJ. Modified from SML/NJ |
2 | * sources, which are | |
3 | * | |
4 | * Copyright (c) 1997 Bell Labs, Lucent Technologies. | |
5 | * | |
6 | *) | |
7 | ||
8 | signature UNSAFE_MONO_ARRAY = | |
9 | sig | |
10 | type array | |
11 | type elem | |
12 | ||
13 | (* omit Size check; | |
14 | * elements have indeterminate value | |
15 | *) | |
16 | val create: int -> array | |
17 | (* omit Subscript check *) | |
18 | val sub: array * int -> elem | |
19 | (* omit Subscript check *) | |
20 | val update: array * int * elem -> unit | |
21 | end | |
22 | ||
23 | (* SML/NJ provides 'create' and 'update', | |
24 | * but they are not provided with MLton, | |
25 | * because vectors are immutable and optimizations may | |
26 | * break if they are updated. | |
27 | *) | |
28 | signature UNSAFE_MONO_VECTOR = | |
29 | sig | |
30 | type elem | |
31 | type vector | |
32 | ||
33 | (* omit Size check; | |
34 | * elements have indeterminate values *) | |
35 | (* val create: int -> vector *) | |
36 | (* omit Subscript check *) | |
37 | val sub: vector * int -> elem | |
38 | (* omit Subscript check *) | |
39 | (* val update: vector * int * elem -> unit *) | |
40 | end | |
41 | ||
42 | signature UNSAFE = | |
43 | sig | |
44 | structure Array: | |
45 | sig | |
46 | (* omit Size check; | |
47 | * objptr(s) at elements set to bogus non-objptr value; | |
48 | * non-objptr(s) at elements have indeterminate value | |
49 | *) | |
50 | val alloc: int -> 'a array | |
51 | (* omit Size check; | |
52 | * elements set to initial value | |
53 | *) | |
54 | val create: int * 'a -> 'a array | |
55 | (* omit Subscript check *) | |
56 | val sub: 'a array * int -> 'a | |
57 | val uninitIsNop: 'a array -> bool | |
58 | (* omit Subscript check; | |
59 | * objptr(s) at element set to bogus non-objptr value | |
60 | *) | |
61 | val uninit: 'a array * int -> unit | |
62 | (* omit Subscript check *) | |
63 | val update: 'a array * int * 'a -> unit | |
64 | ||
65 | structure Raw: | |
66 | sig | |
67 | type 'a rawarr | |
68 | ||
69 | (* omit Size check; | |
70 | * objptr(s) at elements have indeterminate value; | |
71 | * non-objptr(s) at elements have indeterminate value | |
72 | *) | |
73 | val alloc: int -> 'a rawarr | |
74 | (* prereq: all objptr(s) at elements set to bogus | |
75 | * non-objptr value (via uninit) | |
76 | *) | |
77 | val toArray: 'a rawarr -> 'a array | |
78 | val uninitIsNop: 'a rawarr -> bool | |
79 | (* omit Subscript check; | |
80 | * objptr(s) at element set to bogus non-objptr value | |
81 | *) | |
82 | val uninit: 'a rawarr * int -> unit | |
83 | end | |
84 | end | |
85 | structure BoolArray: UNSAFE_MONO_ARRAY | |
86 | structure BoolVector: UNSAFE_MONO_VECTOR | |
87 | structure CharArray: UNSAFE_MONO_ARRAY | |
88 | structure CharVector: UNSAFE_MONO_VECTOR | |
89 | structure IntArray: UNSAFE_MONO_ARRAY | |
90 | structure IntVector: UNSAFE_MONO_VECTOR | |
91 | structure Int8Array: UNSAFE_MONO_ARRAY | |
92 | structure Int8Vector: UNSAFE_MONO_VECTOR | |
93 | structure Int16Array: UNSAFE_MONO_ARRAY | |
94 | structure Int16Vector: UNSAFE_MONO_VECTOR | |
95 | structure Int32Array: UNSAFE_MONO_ARRAY | |
96 | structure Int32Vector: UNSAFE_MONO_VECTOR | |
97 | structure Int64Array: UNSAFE_MONO_ARRAY | |
98 | structure Int64Vector: UNSAFE_MONO_VECTOR | |
99 | structure IntInfArray: UNSAFE_MONO_ARRAY | |
100 | structure IntInfVector: UNSAFE_MONO_VECTOR | |
101 | structure LargeIntArray: UNSAFE_MONO_ARRAY | |
102 | structure LargeIntVector: UNSAFE_MONO_VECTOR | |
103 | structure LargeRealArray: UNSAFE_MONO_ARRAY | |
104 | structure LargeRealVector: UNSAFE_MONO_VECTOR | |
105 | structure LargeWordArray: UNSAFE_MONO_ARRAY | |
106 | structure LargeWordVector: UNSAFE_MONO_VECTOR | |
107 | structure RealArray: UNSAFE_MONO_ARRAY | |
108 | structure RealVector: UNSAFE_MONO_VECTOR | |
109 | structure Real32Array: UNSAFE_MONO_ARRAY | |
110 | structure Real32Vector: UNSAFE_MONO_VECTOR | |
111 | structure Real64Array: UNSAFE_MONO_ARRAY | |
112 | structure Real64Vector: UNSAFE_MONO_VECTOR | |
113 | structure Vector: | |
114 | sig | |
115 | (* val create: int * 'a list -> 'a vector *) | |
116 | val sub: 'a vector * int -> 'a | |
117 | end | |
118 | structure WordArray: UNSAFE_MONO_ARRAY | |
119 | structure WordVector: UNSAFE_MONO_VECTOR | |
120 | structure Word8Array: UNSAFE_MONO_ARRAY | |
121 | structure Word8Vector: UNSAFE_MONO_VECTOR | |
122 | structure Word16Array: UNSAFE_MONO_ARRAY | |
123 | structure Word16Vector: UNSAFE_MONO_VECTOR | |
124 | structure Word32Array: UNSAFE_MONO_ARRAY | |
125 | structure Word32Vector: UNSAFE_MONO_VECTOR | |
126 | structure Word64Array: UNSAFE_MONO_ARRAY | |
127 | structure Word64Vector: UNSAFE_MONO_VECTOR | |
128 | ||
129 | structure PackReal32Big : PACK_REAL | |
130 | structure PackReal32Little : PACK_REAL | |
131 | structure PackReal64Big : PACK_REAL | |
132 | structure PackReal64Little : PACK_REAL | |
133 | structure PackRealBig : PACK_REAL | |
134 | structure PackRealLittle : PACK_REAL | |
135 | structure PackWord16Big : PACK_WORD | |
136 | structure PackWord16Little : PACK_WORD | |
137 | structure PackWord32Big : PACK_WORD | |
138 | structure PackWord32Little : PACK_WORD | |
139 | structure PackWord64Big : PACK_WORD | |
140 | structure PackWord64Little : PACK_WORD | |
141 | end |