Commit | Line | Data |
---|---|---|
7f918cf1 CE |
1 | (* Copyright (C) 2015 Matthew Fluet. |
2 | * Copyright (C) 1999-2007 Henry Cejtin, Matthew Fluet, Suresh | |
3 | * Jagannathan, and Stephen Weeks. | |
4 | * Copyright (C) 1997-2000 NEC Research Institute. | |
5 | * | |
6 | * MLton is released under a BSD-style license. | |
7 | * See the file MLton-LICENSE for details. | |
8 | *) | |
9 | ||
10 | signature EQTYPE_MONO = | |
11 | sig | |
12 | type elem | |
13 | structure MonoArray: MONO_ARRAY_EXTRA | |
14 | structure MonoArray2: MONO_ARRAY2 | |
15 | structure MonoVector: EQTYPE_MONO_VECTOR_EXTRA | |
16 | sharing type MonoArray.array = MonoVector.array | |
17 | sharing type elem = MonoArray.elem = MonoArray2.elem = MonoVector.elem | |
18 | sharing type MonoArray.vector = MonoArray2.vector = MonoVector.vector | |
19 | sharing type MonoArray.MonoArraySlice.vector_slice = MonoVector.MonoVectorSlice.slice | |
20 | end | |
21 | ||
22 | signature MONO = | |
23 | sig | |
24 | type elem | |
25 | structure MonoArray: MONO_ARRAY_EXTRA | |
26 | structure MonoArray2: MONO_ARRAY2 | |
27 | structure MonoVector: MONO_VECTOR_EXTRA | |
28 | sharing type MonoArray.array = MonoVector.array | |
29 | sharing type elem = MonoArray.elem = MonoArray2.elem = MonoVector.elem | |
30 | sharing type MonoArray.vector = MonoArray2.vector = MonoVector.vector | |
31 | sharing type MonoArray.MonoArraySlice.vector_slice = MonoVector.MonoVectorSlice.slice | |
32 | end | |
33 | ||
34 | functor EqtypeMonoX (eqtype elem) = | |
35 | struct | |
36 | type elem = elem | |
37 | structure MonoVector = EqtypeMonoVector (type elem = elem) | |
38 | structure MonoArray = MonoArray (type elem = elem | |
39 | structure MV = MonoVector) | |
40 | structure MonoArray2 = MonoArray2 (type elem = elem | |
41 | structure MV = MonoVector) | |
42 | end | |
43 | ||
44 | functor EqtypeMono (eqtype elem) :> EQTYPE_MONO where type elem = elem = | |
45 | struct | |
46 | type elem = elem | |
47 | structure MonoVector = EqtypeMonoVector (type elem = elem) | |
48 | structure MonoArray = MonoArray (type elem = elem | |
49 | structure MV = MonoVector) | |
50 | structure MonoArray2 = MonoArray2 (type elem = elem | |
51 | structure MV = MonoVector) | |
52 | end | |
53 | ||
54 | functor Mono (type elem) :> MONO where type elem = elem = | |
55 | struct | |
56 | type elem = elem | |
57 | structure MonoVector = MonoVector (type elem = elem) | |
58 | structure MonoArray = MonoArray (type elem = elem | |
59 | structure MV = MonoVector) | |
60 | structure MonoArray2 = MonoArray2 (type elem = elem | |
61 | structure MV = MonoVector) | |
62 | end | |
63 | ||
64 | local | |
65 | structure S = EqtypeMono (type elem = Primitive.Bool.bool) | |
66 | open S | |
67 | in | |
68 | structure BoolVector = MonoVector | |
69 | structure BoolVectorSlice = MonoVector.MonoVectorSlice | |
70 | structure BoolArray = MonoArray | |
71 | structure BoolArraySlice = MonoArray.MonoArraySlice | |
72 | structure BoolArray2 = MonoArray2 | |
73 | end | |
74 | local | |
75 | structure S = EqtypeMono (type elem = Primitive.Int8.int) | |
76 | open S | |
77 | in | |
78 | structure Int8Vector = MonoVector | |
79 | structure Int8VectorSlice = MonoVector.MonoVectorSlice | |
80 | structure Int8Array = MonoArray | |
81 | structure Int8ArraySlice = MonoArray.MonoArraySlice | |
82 | structure Int8Array2 = MonoArray2 | |
83 | end | |
84 | local | |
85 | structure S = EqtypeMono (type elem = Primitive.Int16.int) | |
86 | open S | |
87 | in | |
88 | structure Int16Vector = MonoVector | |
89 | structure Int16VectorSlice = MonoVector.MonoVectorSlice | |
90 | structure Int16Array = MonoArray | |
91 | structure Int16ArraySlice = MonoArray.MonoArraySlice | |
92 | structure Int16Array2 = MonoArray2 | |
93 | end | |
94 | local | |
95 | structure S = EqtypeMono (type elem = Primitive.Int32.int) | |
96 | open S | |
97 | in | |
98 | structure Int32Vector = MonoVector | |
99 | structure Int32VectorSlice = MonoVector.MonoVectorSlice | |
100 | structure Int32Array = MonoArray | |
101 | structure Int32ArraySlice = MonoArray.MonoArraySlice | |
102 | structure Int32Array2 = MonoArray2 | |
103 | end | |
104 | local | |
105 | structure S = EqtypeMono (type elem = Primitive.Int64.int) | |
106 | open S | |
107 | in | |
108 | structure Int64Vector = MonoVector | |
109 | structure Int64VectorSlice = MonoVector.MonoVectorSlice | |
110 | structure Int64Array = MonoArray | |
111 | structure Int64ArraySlice = MonoArray.MonoArraySlice | |
112 | structure Int64Array2 = MonoArray2 | |
113 | end | |
114 | local | |
115 | structure S = EqtypeMono (type elem = Primitive.IntInf.int) | |
116 | open S | |
117 | in | |
118 | structure IntInfVector = MonoVector | |
119 | structure IntInfVectorSlice = MonoVector.MonoVectorSlice | |
120 | structure IntInfArray = MonoArray | |
121 | structure IntInfArraySlice = MonoArray.MonoArraySlice | |
122 | structure IntInfArray2 = MonoArray2 | |
123 | end | |
124 | local | |
125 | structure S = Mono (type elem = Primitive.Real32.real) | |
126 | open S | |
127 | in | |
128 | structure Real32Vector = MonoVector | |
129 | structure Real32VectorSlice = MonoVector.MonoVectorSlice | |
130 | structure Real32Array = MonoArray | |
131 | structure Real32ArraySlice = MonoArray.MonoArraySlice | |
132 | structure Real32Array2 = MonoArray2 | |
133 | end | |
134 | local | |
135 | structure S = Mono (type elem = Primitive.Real64.real) | |
136 | open S | |
137 | in | |
138 | structure Real64Vector = MonoVector | |
139 | structure Real64VectorSlice = MonoVector.MonoVectorSlice | |
140 | structure Real64Array = MonoArray | |
141 | structure Real64ArraySlice = MonoArray.MonoArraySlice | |
142 | structure Real64Array2 = MonoArray2 | |
143 | end | |
144 | local | |
145 | structure S = EqtypeMono (type elem = Primitive.Word8.word) | |
146 | open S | |
147 | in | |
148 | structure Word8Vector = MonoVector | |
149 | structure Word8VectorSlice = MonoVector.MonoVectorSlice | |
150 | structure Word8Array = MonoArray | |
151 | structure Word8ArraySlice = MonoArray.MonoArraySlice | |
152 | structure Word8Array2 = MonoArray2 | |
153 | end | |
154 | local | |
155 | structure S = EqtypeMono (type elem = Primitive.Word16.word) | |
156 | open S | |
157 | in | |
158 | structure Word16Vector = MonoVector | |
159 | structure Word16VectorSlice = MonoVector.MonoVectorSlice | |
160 | structure Word16Array = MonoArray | |
161 | structure Word16ArraySlice = MonoArray.MonoArraySlice | |
162 | structure Word16Array2 = MonoArray2 | |
163 | end | |
164 | local | |
165 | structure S = EqtypeMono (type elem = Primitive.Word32.word) | |
166 | open S | |
167 | in | |
168 | structure Word32Vector = MonoVector | |
169 | structure Word32VectorSlice = MonoVector.MonoVectorSlice | |
170 | structure Word32Array = MonoArray | |
171 | structure Word32ArraySlice = MonoArray.MonoArraySlice | |
172 | structure Word32Array2 = MonoArray2 | |
173 | end | |
174 | local | |
175 | structure S = EqtypeMono (type elem = Primitive.Word64.word) | |
176 | open S | |
177 | in | |
178 | structure Word64Vector = MonoVector | |
179 | structure Word64VectorSlice = MonoVector.MonoVectorSlice | |
180 | structure Word64Array = MonoArray | |
181 | structure Word64ArraySlice = MonoArray.MonoArraySlice | |
182 | structure Word64Array2 = MonoArray2 | |
183 | end | |
184 | ||
185 | ||
186 | local | |
187 | structure S = EqtypeMonoX (type elem = Char.char) | |
188 | open S | |
189 | in | |
190 | structure CharVector = MonoVector | |
191 | structure CharVectorSlice = MonoVector.MonoVectorSlice | |
192 | structure CharArray = MonoArray | |
193 | structure CharArraySlice = MonoArray.MonoArraySlice | |
194 | structure CharArray2 = MonoArray2 | |
195 | end | |
196 | local | |
197 | structure S = EqtypeMonoX (type elem = WideChar.char) | |
198 | open S | |
199 | in | |
200 | structure WideCharVector = MonoVector | |
201 | structure WideCharVectorSlice = MonoVector.MonoVectorSlice | |
202 | structure WideCharArray = MonoArray | |
203 | structure WideCharArraySlice = MonoArray.MonoArraySlice | |
204 | structure WideCharArray2 = MonoArray2 | |
205 | end | |
206 | ||
207 | local | |
208 | structure S = EqtypeMono (type elem = Int.int) | |
209 | open S | |
210 | in | |
211 | structure IntVector = MonoVector | |
212 | structure IntVectorSlice = MonoVector.MonoVectorSlice | |
213 | structure IntArray = MonoArray | |
214 | structure IntArraySlice = MonoArray.MonoArraySlice | |
215 | structure IntArray2 = MonoArray2 | |
216 | end | |
217 | local | |
218 | structure S = EqtypeMono (type elem = LargeInt.int) | |
219 | open S | |
220 | in | |
221 | structure LargeIntVector = MonoVector | |
222 | structure LargeIntVectorSlice = MonoVector.MonoVectorSlice | |
223 | structure LargeIntArray = MonoArray | |
224 | structure LargeIntArraySlice = MonoArray.MonoArraySlice | |
225 | structure LargeIntArray2 = MonoArray2 | |
226 | end | |
227 | local | |
228 | structure S = Mono (type elem = Real.real) | |
229 | open S | |
230 | in | |
231 | structure RealVector = MonoVector | |
232 | structure RealVectorSlice = MonoVector.MonoVectorSlice | |
233 | structure RealArray = MonoArray | |
234 | structure RealArraySlice = MonoArray.MonoArraySlice | |
235 | structure RealArray2 = MonoArray2 | |
236 | end | |
237 | local | |
238 | structure S = Mono (type elem = LargeReal.real) | |
239 | open S | |
240 | in | |
241 | structure LargeRealVector = MonoVector | |
242 | structure LargeRealVectorSlice = MonoVector.MonoVectorSlice | |
243 | structure LargeRealArray = MonoArray | |
244 | structure LargeRealArraySlice = MonoArray.MonoArraySlice | |
245 | structure LargeRealArray2 = MonoArray2 | |
246 | end | |
247 | local | |
248 | structure S = EqtypeMono (type elem = Word.word) | |
249 | open S | |
250 | in | |
251 | structure WordVector = MonoVector | |
252 | structure WordVectorSlice = MonoVector.MonoVectorSlice | |
253 | structure WordArray = MonoArray | |
254 | structure WordArraySlice = MonoArray.MonoArraySlice | |
255 | structure WordArray2 = MonoArray2 | |
256 | end | |
257 | local | |
258 | structure S = EqtypeMono (type elem = LargeWord.word) | |
259 | open S | |
260 | in | |
261 | structure LargeWordVector = MonoVector | |
262 | structure LargeWordVectorSlice = MonoVector.MonoVectorSlice | |
263 | structure LargeWordArray = MonoArray | |
264 | structure LargeWordArraySlice = MonoArray.MonoArraySlice | |
265 | structure LargeWordArray2 = MonoArray2 | |
266 | end |