comparison src/core_util.sml @ 621:8998114760c1

"Hello world" compiles, after replacing type-level fold with map
author Adam Chlipala <adamc@hcoop.net>
date Sat, 21 Feb 2009 15:33:20 -0500
parents 56aaa1941dad
children 588b9d16b00a
comparison
equal deleted inserted replaced
620:d828b143e147 621:8998114760c1
176 join (compare (f1, f2), 176 join (compare (f1, f2),
177 fn () => compare (s1, s2)) 177 fn () => compare (s1, s2))
178 | (CConcat _, _) => LESS 178 | (CConcat _, _) => LESS
179 | (_, CConcat _) => GREATER 179 | (_, CConcat _) => GREATER
180 180
181 | (CFold (d1, r1), CFold (d2, r2)) => 181 | (CMap (d1, r1), CMap (d2, r2)) =>
182 join (Kind.compare (d1, r2), 182 join (Kind.compare (d1, r2),
183 fn () => Kind.compare (r1, r2)) 183 fn () => Kind.compare (r1, r2))
184 | (CFold _, _) => LESS 184 | (CMap _, _) => LESS
185 | (_, CFold _) => GREATER 185 | (_, CMap _) => GREATER
186 186
187 | (CUnit, CUnit) => EQUAL 187 | (CUnit, CUnit) => EQUAL
188 | (CUnit, _) => LESS 188 | (CUnit, _) => LESS
189 | (_, CUnit) => GREATER 189 | (_, CUnit) => GREATER
190 190
259 S.bind2 (mfc ctx c1, 259 S.bind2 (mfc ctx c1,
260 fn c1' => 260 fn c1' =>
261 S.map2 (mfc ctx c2, 261 S.map2 (mfc ctx c2,
262 fn c2' => 262 fn c2' =>
263 (CConcat (c1', c2'), loc))) 263 (CConcat (c1', c2'), loc)))
264 | CFold (k1, k2) => 264 | CMap (k1, k2) =>
265 S.bind2 (mfk k1, 265 S.bind2 (mfk k1,
266 fn k1' => 266 fn k1' =>
267 S.map2 (mfk k2, 267 S.map2 (mfk k2,
268 fn k2' => 268 fn k2' =>
269 (CFold (k1', k2'), loc))) 269 (CMap (k1', k2'), loc)))
270 270
271 | CUnit => S.return2 cAll 271 | CUnit => S.return2 cAll
272 272
273 | CTuple cs => 273 | CTuple cs =>
274 S.map2 (ListUtil.mapfold (mfc ctx) cs, 274 S.map2 (ListUtil.mapfold (mfc ctx) cs,