comparison src/explify.sml @ 449:89f766f19d5b

Explify 'let'
author Adam Chlipala <adamc@hcoop.net>
date Sat, 01 Nov 2008 16:08:39 -0400
parents dfc8c991abd0
children d34834af4512
comparison
equal deleted inserted replaced
448:85819353a84f 449:89f766f19d5b
114 114
115 | L.EError => raise Fail ("explifyExp: EError at " ^ EM.spanToString loc) 115 | L.EError => raise Fail ("explifyExp: EError at " ^ EM.spanToString loc)
116 | L.EUnif (ref (SOME e)) => explifyExp e 116 | L.EUnif (ref (SOME e)) => explifyExp e
117 | L.EUnif _ => raise Fail ("explifyExp: Undetermined EUnif at " ^ EM.spanToString loc) 117 | L.EUnif _ => raise Fail ("explifyExp: Undetermined EUnif at " ^ EM.spanToString loc)
118 118
119 | L.ELet (des, e) =>
120 foldr (fn ((de, loc), e) =>
121 case de of
122 L.EDValRec _ => raise Fail "explifyExp: Local 'val rec' remains"
123 | L.EDVal (x, t, e') => (L'.ELet (x, explifyCon t, explifyExp e', e), loc))
124 (explifyExp e) des
125
119 fun explifySgi (sgi, loc) = 126 fun explifySgi (sgi, loc) =
120 case sgi of 127 case sgi of
121 L.SgiConAbs (x, n, k) => SOME (L'.SgiConAbs (x, n, explifyKind k), loc) 128 L.SgiConAbs (x, n, k) => SOME (L'.SgiConAbs (x, n, explifyKind k), loc)
122 | L.SgiCon (x, n, k, c) => SOME (L'.SgiCon (x, n, explifyKind k, explifyCon c), loc) 129 | L.SgiCon (x, n, k, c) => SOME (L'.SgiCon (x, n, explifyKind k, explifyCon c), loc)
123 | L.SgiDatatype (x, n, xs, xncs) => SOME (L'.SgiDatatype (x, n, xs, 130 | L.SgiDatatype (x, n, xs, xncs) => SOME (L'.SgiDatatype (x, n, xs,