comparison src/monoize.sml @ 807:61a1f5c5ae2c

Mutual datatypes through Effectize
author Adam Chlipala <adamc@hcoop.net>
date Sat, 16 May 2009 15:45:12 -0400
parents 152b61b2901a
children d8f58d488cfb
comparison
equal deleted inserted replaced
806:0e554bfd6d6a 807:61a1f5c5ae2c
3043 Print.eprefaces' [("Declaration", CorePrint.p_decl env all)]; 3043 Print.eprefaces' [("Declaration", CorePrint.p_decl env all)];
3044 NONE) 3044 NONE)
3045 in 3045 in
3046 case d of 3046 case d of
3047 L.DCon _ => NONE 3047 L.DCon _ => NONE
3048 | L.DDatatype (x, n, [], xncs) => 3048 | L.DDatatype _ => raise Fail "Monoize DDatatype"
3049 (*| L.DDatatype (x, n, [], xncs) =>
3049 let 3050 let
3050 val env' = Env.declBinds env all 3051 val env' = Env.declBinds env all
3051 val d = (L'.DDatatype (x, n, map (fn (x, n, to) => (x, n, Option.map (monoType env') to)) xncs), loc) 3052 val d = (L'.DDatatype (x, n, map (fn (x, n, to) => (x, n, Option.map (monoType env') to)) xncs), loc)
3052 in 3053 in
3053 SOME (env', fm, [d]) 3054 SOME (env', fm, [d])
3062 _))]), _), _))]) => 3063 _))]), _), _))]) =>
3063 if n = n' then 3064 if n = n' then
3064 NONE 3065 NONE
3065 else 3066 else
3066 poly () 3067 poly ()
3067 | L.DDatatype _ => poly () 3068 | L.DDatatype _ => poly ()*)
3068 | L.DVal (x, n, t, e, s) => 3069 | L.DVal (x, n, t, e, s) =>
3069 let 3070 let
3070 val (e, fm) = monoExp (env, St.empty, fm) e 3071 val (e, fm) = monoExp (env, St.empty, fm) e
3071 in 3072 in
3072 SOME (Env.pushENamed env x n t NONE s, 3073 SOME (Env.pushENamed env x n t NONE s,