diff src/elaborate.sml @ 834:74e9e7642f08

Do 'open constraints' automatically; fix sourceless <cselect> monoize bug; Monad library module
author Adam Chlipala <adamc@hcoop.net>
date Tue, 02 Jun 2009 11:50:53 -0400
parents 9a1026e2b3f5
children ccf22c2c77b2
line wrap: on
line diff
--- a/src/elaborate.sml	Sun May 31 15:25:27 2009 -0400
+++ b/src/elaborate.sml	Tue Jun 02 11:50:53 2009 -0400
@@ -3355,6 +3355,10 @@
                             end
 
                     val (env', n) = E.pushStrNamed env x sgn'
+                    val denv' =
+                        case #1 str' of
+                            L'.StrConst _ => dopenConstraints (loc, env', denv) {str = x, strs = []}
+                          | _ => denv
                 in
                     case #1 (hnormSgn env sgn') of
                         L'.SgnFun _ =>
@@ -3363,7 +3367,7 @@
                            | _ => strError env (FunctorRebind loc))
                       | _ => ();
 
-                    ([(L'.DStr (x, n, sgn', str'), loc)], (env', denv, gs' @ gs))
+                    ([(L'.DStr (x, n, sgn', str'), loc)], (env', denv', gs' @ gs))
                 end
 
               | L.DFfiStr (x, sgn) =>
@@ -3721,14 +3725,15 @@
         let
             val (dom', gs1) = elabSgn (env, denv) dom
             val (env', n) = E.pushStrNamed env m dom'
-            val (str', actual, gs2) = elabStr (env', denv) str
+            val denv' = dopenConstraints (loc, env', denv) {str = m, strs = []}
+            val (str', actual, gs2) = elabStr (env', denv') str
 
             val (formal, gs3) =
                 case ranO of
                     NONE => (actual, [])
                   | SOME ran =>
                     let
-                        val (ran', gs) = elabSgn (env', denv) ran
+                        val (ran', gs) = elabSgn (env', denv') ran
                     in
                         subSgn env' actual ran';
                         (ran', gs)