diff options
author | Adam Chlipala <adamc@hcoop.net> | 2008-08-03 19:49:21 -0400 |
---|---|---|
committer | Adam Chlipala <adamc@hcoop.net> | 2008-08-03 19:49:21 -0400 |
commit | 744cdbb9e3907db9bb01576750634c614147e1a3 (patch) | |
tree | aecef31d4055d34a31977834cbda020811d1dfab /src/mono_env.sml | |
parent | 9a9f1738a8eae9df07f97da224cd9cf45033e9dc (diff) |
Datatype representation optimization
Diffstat (limited to 'src/mono_env.sml')
-rw-r--r-- | src/mono_env.sml | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/mono_env.sml b/src/mono_env.sml index f5f1f3d9..3beced1c 100644 --- a/src/mono_env.sml +++ b/src/mono_env.sml @@ -98,9 +98,10 @@ fun declBinds env (d, loc) = DDatatype (x, n, xncs) => let val env = pushDatatype env x n xncs + val dt = (TDatatype (MonoUtil.classifyDatatype xncs, n, xncs), loc) in - foldl (fn ((x', n', NONE), env) => pushENamed env x' n' (TDatatype (n, xncs), loc) NONE "" - | ((x', n', SOME t), env) => pushENamed env x' n' (TFun (t, (TDatatype (n, xncs), loc)), loc) NONE "") + foldl (fn ((x', n', NONE), env) => pushENamed env x' n' dt NONE "" + | ((x', n', SOME t), env) => pushENamed env x' n' (TFun (t, dt), loc) NONE "") env xncs end | DVal (x, n, t, e, s) => pushENamed env x n t (SOME e) s @@ -112,8 +113,8 @@ fun patBinds env (p, loc) = PWild => env | PVar (x, t) => pushERel env x t NONE | PPrim _ => env - | PCon (_, NONE) => env - | PCon (_, SOME p) => patBinds env p + | PCon (_, _, NONE) => env + | PCon (_, _, SOME p) => patBinds env p | PRecord xps => foldl (fn ((_, p, _), env) => patBinds env p) env xps end |