comparison src/explify.sml @ 59:abb2b32c19fb

Subsignatures
author Adam Chlipala <adamc@hcoop.net>
date Sun, 22 Jun 2008 19:10:38 -0400
parents 0a5c312de09a
children d609820c5834
comparison
equal deleted inserted replaced
58:fd8a81ecd598 59:abb2b32c19fb
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 91
91 and explifySgn (sgn, loc) = 92 and explifySgn (sgn, loc) =
92 case sgn of 93 case sgn of
93 L.SgnConst sgis => (L'.SgnConst (map explifySgi sgis), loc) 94 L.SgnConst sgis => (L'.SgnConst (map explifySgi sgis), loc)
94 | L.SgnVar n => (L'.SgnVar n, loc) 95 | L.SgnVar n => (L'.SgnVar n, loc)
95 | 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)
96 | 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"
97 | L.SgnError => raise Fail ("explifySgn: SgnError at " ^ EM.spanToString loc) 99 | L.SgnError => raise Fail ("explifySgn: SgnError at " ^ EM.spanToString loc)
98 100
99 fun explifyDecl (d, loc : EM.span) = 101 fun explifyDecl (d, loc : EM.span) =
100 case d of 102 case d of
101 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)