comparison src/explify.sml @ 211:e86411f647c6

Initial type class support
author Adam Chlipala <adamc@hcoop.net>
date Sat, 16 Aug 2008 14:32:18 -0400
parents 63a2f2322c1f
children 0343557355fc
comparison
equal deleted inserted replaced
210:f4033abd6ab1 211:e86411f647c6
126 | L.SgiVal (x, n, c) => SOME (L'.SgiVal (x, n, explifyCon c), loc) 126 | L.SgiVal (x, n, c) => SOME (L'.SgiVal (x, n, explifyCon c), loc)
127 | L.SgiStr (x, n, sgn) => SOME (L'.SgiStr (x, n, explifySgn sgn), loc) 127 | L.SgiStr (x, n, sgn) => SOME (L'.SgiStr (x, n, explifySgn sgn), loc)
128 | L.SgiSgn (x, n, sgn) => SOME (L'.SgiSgn (x, n, explifySgn sgn), loc) 128 | L.SgiSgn (x, n, sgn) => SOME (L'.SgiSgn (x, n, explifySgn sgn), loc)
129 | L.SgiConstraint _ => NONE 129 | L.SgiConstraint _ => NONE
130 | L.SgiTable _ => raise Fail "Explify SgiTable" 130 | L.SgiTable _ => raise Fail "Explify SgiTable"
131 | L.SgiClassAbs (x, n) => SOME (L'.SgiConAbs (x, n, (L'.KArrow ((L'.KType, loc), (L'.KType, loc)), loc)), loc)
132 | L.SgiClass (x, n, c) => SOME (L'.SgiCon (x, n, (L'.KArrow ((L'.KType, loc), (L'.KType, loc)), loc),
133 explifyCon c), loc)
131 134
132 and explifySgn (sgn, loc) = 135 and explifySgn (sgn, loc) =
133 case sgn of 136 case sgn of
134 L.SgnConst sgis => (L'.SgnConst (List.mapPartial explifySgi sgis), loc) 137 L.SgnConst sgis => (L'.SgnConst (List.mapPartial explifySgi sgis), loc)
135 | L.SgnVar n => (L'.SgnVar n, loc) 138 | L.SgnVar n => (L'.SgnVar n, loc)