summaryrefslogtreecommitdiff
path: root/src/core_env.sml
diff options
context:
space:
mode:
authorGravatar Adam Chlipala <adamc@hcoop.net>2009-05-16 15:45:12 -0400
committerGravatar Adam Chlipala <adamc@hcoop.net>2009-05-16 15:45:12 -0400
commit41f7bb23ff2a9598f8f3bff1487f39f9e91f9f05 (patch)
treec5073d9b7f368aa38bb4d146c0a6b21900ef1f79 /src/core_env.sml
parent6cb3888614811abc30c6a00a1644e256d1d1c780 (diff)
Mutual datatypes through Effectize
Diffstat (limited to 'src/core_env.sml')
-rw-r--r--src/core_env.sml19
1 files changed, 10 insertions, 9 deletions
diff --git a/src/core_env.sml b/src/core_env.sml
index 0630fef2..e8cd139f 100644
--- a/src/core_env.sml
+++ b/src/core_env.sml
@@ -301,15 +301,16 @@ fun lookupENamed (env : env) n =
fun declBinds env (d, loc) =
case d of
DCon (x, n, k, c) => pushCNamed env x n k (SOME c)
- | DDatatype (x, n, xs, xncs) =>
- let
- val env = pushDatatype env x n xs xncs
- val env = pushCNamed env x n (KType, loc) NONE
- in
- foldl (fn ((x', n', NONE), env) => pushENamed env x' n' (CNamed n, loc) NONE ""
- | ((x', n', SOME t), env) => pushENamed env x' n' (TFun (t, (CNamed n, loc)), loc) NONE "")
- env xncs
- end
+ | DDatatype dts =>
+ foldl (fn ((x, n, xs, xncs), env) =>
+ let
+ val env = pushDatatype env x n xs xncs
+ val env = pushCNamed env x n (KType, loc) NONE
+ in
+ foldl (fn ((x', n', NONE), env) => pushENamed env x' n' (CNamed n, loc) NONE ""
+ | ((x', n', SOME t), env) => pushENamed env x' n' (TFun (t, (CNamed n, loc)), loc) NONE "")
+ env xncs
+ end) env dts
| DVal (x, n, t, e, s) => pushENamed env x n t (SOME e) s
| DValRec vis => foldl (fn ((x, n, t, e, s), env) => pushENamed env x n t NONE s) env vis
| DExport _ => env