diff options
Diffstat (limited to 'src/cjr_env.sml')
-rw-r--r-- | src/cjr_env.sml | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/src/cjr_env.sml b/src/cjr_env.sml index 54dbea17..217efb3a 100644 --- a/src/cjr_env.sml +++ b/src/cjr_env.sml @@ -137,15 +137,16 @@ fun classifyDatatype xncs = fun declBinds env (d, loc) = case d of - DDatatype (_, x, n, xncs) => - let - val env = pushDatatype env x n xncs - val dt = (TDatatype (classifyDatatype xncs, n, ref xncs), loc) - in - foldl (fn ((x', n', NONE), env) => pushENamed env x' n' dt - | ((x', n', SOME t), env) => pushENamed env x' n' (TFun (t, dt), loc)) - env xncs - end + DDatatype dts => + foldl (fn ((_, x, n, xncs), env) => + let + val env = pushDatatype env x n xncs + val dt = (TDatatype (classifyDatatype xncs, n, ref xncs), loc) + in + foldl (fn ((x', n', NONE), env) => pushENamed env x' n' dt + | ((x', n', SOME t), env) => pushENamed env x' n' (TFun (t, dt), loc)) + env xncs + end) env dts | DDatatypeForward (_, x, n) => pushDatatype env x n [] | DStruct (n, xts) => pushStruct env n xts | DVal (x, n, t, _) => pushENamed env x n t |