comparison src/cjr_env.sml @ 168:25b169416ea8

Storing datatype constructors in type references past monoize
author Adam Chlipala <adamc@hcoop.net>
date Tue, 29 Jul 2008 15:43:17 -0400
parents a991431b77eb
children 31dfab1d4050
comparison
equal deleted inserted replaced
167:2be573fec9a6 168:25b169416ea8
120 case d of 120 case d of
121 DDatatype (x, n, xncs) => 121 DDatatype (x, n, xncs) =>
122 let 122 let
123 val env = pushDatatype env x n xncs 123 val env = pushDatatype env x n xncs
124 in 124 in
125 foldl (fn ((x', n', NONE), env) => pushENamed env x' n' (TDatatype n, loc) 125 foldl (fn ((x', n', NONE), env) => pushENamed env x' n' (TDatatype (n, xncs), loc)
126 | ((x', n', SOME t), env) => pushENamed env x' n' (TFun (t, (TDatatype n, loc)), loc)) 126 | ((x', n', SOME t), env) => pushENamed env x' n' (TFun (t, (TDatatype (n, xncs), loc)), loc))
127 env xncs 127 env xncs
128 end 128 end
129 | DStruct (n, xts) => pushStruct env n xts 129 | DStruct (n, xts) => pushStruct env n xts
130 | DVal (x, n, t, _) => pushENamed env x n t 130 | DVal (x, n, t, _) => pushENamed env x n t
131 | DFun (fx, n, args, ran, _) => 131 | DFun (fx, n, args, ran, _) =>