diff src/mono_env.sml @ 183:c0ea24dcb86f

Optimizing 'case' in Mono_reduce
author Adam Chlipala <adamc@hcoop.net>
date Sun, 03 Aug 2008 13:30:27 -0400
parents d11754ffe252
children 8e9f97508f0d
line wrap: on
line diff
--- a/src/mono_env.sml	Sun Aug 03 12:43:20 2008 -0400
+++ b/src/mono_env.sml	Sun Aug 03 13:30:27 2008 -0400
@@ -39,7 +39,7 @@
      datatypes : (string * (string * int * typ option) list) IM.map,
      constructors : (string * typ option * int) IM.map,
 
-     relE : (string * typ) list,
+     relE : (string * typ * exp option) list,
      namedE : (string * typ * exp option * string) IM.map
 }
 
@@ -70,11 +70,11 @@
         NONE => raise UnboundNamed n
       | SOME x => x
 
-fun pushERel (env : env) x t =
+fun pushERel (env : env) x t eo =
     {datatypes = #datatypes env,
      constructors = #constructors env,
 
-     relE = (x, t) :: #relE env,
+     relE = (x, t, eo) :: #relE env,
      namedE = #namedE env}
 
 fun lookupERel (env : env) n =
@@ -110,7 +110,7 @@
 fun patBinds env (p, loc) =
     case p of
         PWild => env
-      | PVar (x, t) => pushERel env x t
+      | PVar (x, t) => pushERel env x t NONE
       | PPrim _ => env
       | PCon (_, NONE) => env
       | PCon (_, SOME p) => patBinds env p