Mercurial > urweb
comparison src/corify.sml @ 480:40c737913075
Especialize handles records better
author | Adam Chlipala <adamc@hcoop.net> |
---|---|
date | Sat, 08 Nov 2008 16:02:59 -0500 |
parents | 5c9606deacb6 |
children | ae03d09043c1 |
comparison
equal
deleted
inserted
replaced
479:ffa18975e661 | 480:40c737913075 |
---|---|
385 nested = nested} | 385 nested = nested} |
386 | bindStr _ _ _ _ = raise Fail "Corify.St.bindStr" | 386 | bindStr _ _ _ _ = raise Fail "Corify.St.bindStr" |
387 | 387 |
388 fun lookupStrById ({basis, strs, ...} : t) n = | 388 fun lookupStrById ({basis, strs, ...} : t) n = |
389 case IM.find (strs, n) of | 389 case IM.find (strs, n) of |
390 NONE => raise Fail "Corify.St.lookupStrById" | 390 NONE => raise Fail ("Corify.St.lookupStrById(" ^ Int.toString n ^ ")") |
391 | SOME f => dummy (basis, f) | 391 | SOME f => dummy (basis, f) |
392 | 392 |
393 fun lookupStrByName (m, {basis, current = FNormal {strs, ...}, ...} : t) = | 393 fun lookupStrByName (m, {basis, current = FNormal {strs, ...}, ...} : t) = |
394 (case SM.find (strs, m) of | 394 (case SM.find (strs, m) of |
395 NONE => raise Fail "Corify.St.lookupStrByName [1]" | 395 NONE => raise Fail "Corify.St.lookupStrByName [1]" |
600 | 600 |
601 | L.EWrite e => (L'.EWrite (corifyExp st e), loc) | 601 | L.EWrite e => (L'.EWrite (corifyExp st e), loc) |
602 | 602 |
603 | L.ELet (x, t, e1, e2) => (L'.ELet (x, corifyCon st t, corifyExp st e1, corifyExp st e2), loc) | 603 | L.ELet (x, t, e1, e2) => (L'.ELet (x, corifyCon st t, corifyExp st e1, corifyExp st e2), loc) |
604 | 604 |
605 fun corifyDecl mods ((d, loc : EM.span), st) = | 605 fun corifyDecl mods (all as (d, loc : EM.span), st) = |
606 case d of | 606 case d of |
607 L.DCon (x, n, k, c) => | 607 L.DCon (x, n, k, c) => |
608 let | 608 let |
609 val (st, n) = St.bindCon st x n | 609 val (st, n) = St.bindCon st x n |
610 in | 610 in |