comparison src/explify.sml @ 64:d609820c5834

Proper hiding of shadowed bindings in principal signatures
author Adam Chlipala <adamc@hcoop.net>
date Thu, 26 Jun 2008 08:54:49 -0400
parents abb2b32c19fb
children 9f89f0b00b84
comparison
equal deleted inserted replaced
63:c5a503ad0d8c 64:d609820c5834
85 case sgi of 85 case sgi of
86 L.SgiConAbs (x, n, k) => (L'.SgiConAbs (x, n, explifyKind k), loc) 86 L.SgiConAbs (x, n, k) => (L'.SgiConAbs (x, n, explifyKind k), loc)
87 | L.SgiCon (x, n, k, c) => (L'.SgiCon (x, n, explifyKind k, explifyCon c), loc) 87 | L.SgiCon (x, n, k, c) => (L'.SgiCon (x, n, explifyKind k, explifyCon c), loc)
88 | L.SgiVal (x, n, c) => (L'.SgiVal (x, n, explifyCon c), loc) 88 | L.SgiVal (x, n, c) => (L'.SgiVal (x, n, explifyCon c), loc)
89 | L.SgiStr (x, n, sgn) => (L'.SgiStr (x, n, explifySgn sgn), loc) 89 | L.SgiStr (x, n, sgn) => (L'.SgiStr (x, n, explifySgn sgn), loc)
90 | L.SgiSgn _ => raise Fail "Explify SgiSgn" 90 | L.SgiSgn (x, n, sgn) => (L'.SgiSgn (x, n, explifySgn sgn), loc)
91 91
92 and explifySgn (sgn, loc) = 92 and explifySgn (sgn, loc) =
93 case sgn of 93 case sgn of
94 L.SgnConst sgis => (L'.SgnConst (map explifySgi sgis), loc) 94 L.SgnConst sgis => (L'.SgnConst (map explifySgi sgis), loc)
95 | L.SgnVar n => (L'.SgnVar n, loc) 95 | L.SgnVar n => (L'.SgnVar n, loc)
96 | L.SgnFun (m, n, dom, ran) => (L'.SgnFun (m, n, explifySgn dom, explifySgn ran), loc) 96 | L.SgnFun (m, n, dom, ran) => (L'.SgnFun (m, n, explifySgn dom, explifySgn ran), loc)
97 | L.SgnWhere (sgn, x, c) => (L'.SgnWhere (explifySgn sgn, x, explifyCon c), loc) 97 | L.SgnWhere (sgn, x, c) => (L'.SgnWhere (explifySgn sgn, x, explifyCon c), loc)
98 | L.SgnProj _ => raise Fail "Explify SgnProj" 98 | L.SgnProj x => (L'.SgnProj x, loc)
99 | L.SgnError => raise Fail ("explifySgn: SgnError at " ^ EM.spanToString loc) 99 | L.SgnError => raise Fail ("explifySgn: SgnError at " ^ EM.spanToString loc)
100 100
101 fun explifyDecl (d, loc : EM.span) = 101 fun explifyDecl (d, loc : EM.span) =
102 case d of 102 case d of
103 L.DCon (x, n, k, c) => (L'.DCon (x, n, explifyKind k, explifyCon c), loc) 103 L.DCon (x, n, k, c) => (L'.DCon (x, n, explifyKind k, explifyCon c), loc)