comparison src/explify.sml @ 825:7f871c03e3a1

Destructing local let, to the point where demo compiles
author Adam Chlipala <adamc@hcoop.net>
date Thu, 28 May 2009 12:07:05 -0400
parents 0e554bfd6d6a
children b2311dfb3158
comparison
equal deleted inserted replaced
824:be0988e46336 825:7f871c03e3a1
121 121
122 | L.EError => raise Fail ("explifyExp: EError at " ^ EM.spanToString loc) 122 | L.EError => raise Fail ("explifyExp: EError at " ^ EM.spanToString loc)
123 | L.EUnif (ref (SOME e)) => explifyExp e 123 | L.EUnif (ref (SOME e)) => explifyExp e
124 | L.EUnif _ => raise Fail ("explifyExp: Undetermined EUnif at " ^ EM.spanToString loc) 124 | L.EUnif _ => raise Fail ("explifyExp: Undetermined EUnif at " ^ EM.spanToString loc)
125 125
126 | L.ELet (des, e) => 126 | L.ELet (des, e, t) =>
127 foldr (fn ((de, loc), e) => 127 foldr (fn ((de, loc), e) =>
128 case de of 128 case de of
129 L.EDValRec _ => raise Fail "explifyExp: Local 'val rec' remains" 129 L.EDValRec _ => raise Fail "explifyExp: Local 'val rec' remains"
130 | L.EDVal (x, t, e') => (L'.ELet (x, explifyCon t, explifyExp e', e), loc)) 130 | L.EDVal ((L.PVar (x, _), _), t', e') => (L'.ELet (x, explifyCon t', explifyExp e', e), loc)
131 | L.EDVal (p, t', e') => (L'.ECase (explifyExp e',
132 [(explifyPat p, e)],
133 {disc = explifyCon t', result = explifyCon t}), loc))
131 (explifyExp e) des 134 (explifyExp e) des
132 135
133 | L.EKAbs (x, e) => (L'.EKAbs (x, explifyExp e), loc) 136 | L.EKAbs (x, e) => (L'.EKAbs (x, explifyExp e), loc)
134 | L.EKApp (e, k) => (L'.EKApp (explifyExp e, explifyKind k), loc) 137 | L.EKApp (e, k) => (L'.EKApp (explifyExp e, explifyKind k), loc)
135 138