Mercurial > urweb
comparison src/elaborate.sml @ 2043:e762c96fffb7
Small tweak to ordering of unification rules, to support better record matching
author | Adam Chlipala <adam@chlipala.net> |
---|---|
date | Tue, 29 Jul 2014 14:38:50 -0400 |
parents | 403f0cc65b9c |
children | 42ae25a354f8 |
comparison
equal
deleted
inserted
replaced
2042:336070df8aec | 2043:e762c96fffb7 |
---|---|
1218 else | 1218 else |
1219 err CScope) | 1219 err CScope) |
1220 else | 1220 else |
1221 err (fn _ => TooLifty (loc1, loc2)) | 1221 err (fn _ => TooLifty (loc1, loc2)) |
1222 | 1222 |
1223 | (L'.CRecord _, _) => isRecord () | |
1224 | (_, L'.CRecord _) => isRecord () | |
1225 | (L'.CConcat _, _) => isRecord () | |
1226 | (_, L'.CConcat _) => isRecord () | |
1227 | |
1223 | (L'.CUnif (0, _, _, _, r as ref (L'.Unknown f)), _) => | 1228 | (L'.CUnif (0, _, _, _, r as ref (L'.Unknown f)), _) => |
1224 if occursCon r c2All then | 1229 if occursCon r c2All then |
1225 err COccursCheckFailed | 1230 err COccursCheckFailed |
1226 else if f c2All then | 1231 else if f c2All then |
1227 r := L'.Known c2All | 1232 r := L'.Known c2All |
1259 r := L'.Known sq | 1264 r := L'.Known sq |
1260 else | 1265 else |
1261 err CScope | 1266 err CScope |
1262 end | 1267 end |
1263 handle CantSquish => err (fn _ => TooDeep)) | 1268 handle CantSquish => err (fn _ => TooDeep)) |
1264 | |
1265 | (L'.CRecord _, _) => isRecord () | |
1266 | (_, L'.CRecord _) => isRecord () | |
1267 | (L'.CConcat _, _) => isRecord () | |
1268 | (_, L'.CConcat _) => isRecord () | |
1269 | 1269 |
1270 | 1270 |
1271 | (L'.CUnit, L'.CUnit) => () | 1271 | (L'.CUnit, L'.CUnit) => () |
1272 | 1272 |
1273 | (L'.TFun (d1, r1), L'.TFun (d2, r2)) => | 1273 | (L'.TFun (d1, r1), L'.TFun (d2, r2)) => |