[further seperate out concrete types to speed up checking
John Meacham <john@repetae.net>**20100806092815
 Ignore-this: f992ced583042d3c7797d4de93e3e3a8
] hunk ./src/FrontEnd/Tc/Monad.hs 54
+import qualified Control.Applicative as T
hunk ./src/FrontEnd/Tc/Monad.hs 139
-    te' <- mapM (\ (x,y) -> do y <- flattenType y; return (x,y)) (Map.toList te)
-    if any isBoxy (snds te') then
-        fail $ "localEnv error!\n" ++ show te
-     else local (tcMutableEnv_u (Map.fromList te' `Map.union`)) act
+    te' <- T.mapM flattenType te
+    let (cenv,menv) = Map.partition (Set.null . freeMetaVars) te'
+    --if any isBoxy (Map.elems te') then
+    --    fail $ "localEnv error!\n" ++ show te
+    local (tcConcreteEnv_u (cenv `Map.union`) . tcMutableEnv_u ((menv `Map.union`) . Map.filterWithKey (\k _ -> k `Map.notMember` cenv))) act
hunk ./src/FrontEnd/Tc/Type.hs 151
-flattenType t =  unVar UnVarOpt { failEmptyMetaVar = False } t
+flattenType t = liftIO $ unVar' t
hunk ./src/FrontEnd/Tc/Type.hs 156
-    unVar' ::  UnVarOpt -> t -> IO t
-
-unVar :: (UnVar t, MonadIO m) => UnVarOpt -> t -> m t
-unVar opt t = liftIO (unVar' opt t)
+    unVar' ::   t -> IO t
hunk ./src/FrontEnd/Tc/Type.hs 159
-   unVar' opt xs = mapM (unVar' opt) xs
+   unVar' xs = mapM unVar' xs
hunk ./src/FrontEnd/Tc/Type.hs 162
-    unVar' opt (IsIn c t) = IsIn c `liftM` unVar' opt t
-    unVar' opt (IsEq t1 t2) = liftM2 IsEq (unVar' opt t1) (unVar' opt t2)
+    unVar' (IsIn c t) = IsIn c `liftM` unVar' t
+    unVar' (IsEq t1 t2) = liftM2 IsEq (unVar' t1) (unVar' t2)
hunk ./src/FrontEnd/Tc/Type.hs 166
-    unVar' opt (a,b) = do
-        a <- unVar' opt a
-        b <- unVar' opt b
+    unVar' (a,b) = do
+        a <- unVar' a
+        b <- unVar' b
hunk ./src/FrontEnd/Tc/Type.hs 172
-    unVar' opt (ps :=> t) = liftM2 (:=>) (unVar' opt ps) (unVar' opt t)
+    unVar' (ps :=> t) = liftM2 (:=>) (unVar' ps) (unVar' t)
hunk ./src/FrontEnd/Tc/Type.hs 175
-    unVar' opt tv =  do
+    unVar' tv =  do
hunk ./src/FrontEnd/Tc/Type.hs 177
-                qt' <- unVar' opt qt
+                qt' <- unVar' qt
hunk ./src/FrontEnd/Tc/Type.hs 180
-                qt' <- unVar' opt qt
+                qt' <- unVar' qt
hunk ./src/FrontEnd/Tc/Type.hs 183
-            ft t@(TMetaVar _) = if failEmptyMetaVar opt then fail $ "empty meta var" ++ prettyPrintType t else return t
-            ft t = tickleM (unVar' opt . (id :: Type -> Type)) t
+            ft t@(TMetaVar _) = return t
+            ft t = tickleM (unVar' . (id :: Type -> Type)) t
hunk ./src/FrontEnd/Tc/Type.hs 353
-    unVar' opt (CTAp ts) = CTAp `liftM` unVar' opt ts
-    unVar' opt (CTFun ct) = CTFun `liftM` unVar' opt ct
-    unVar' opt (CTCompose c1 c2) = liftM2 CTCompose (unVar' opt c1) (unVar' opt c2)
-    unVar' _ x = return x
+    unVar' (CTAp ts) = CTAp `liftM` unVar' ts
+    unVar' (CTFun ct) = CTFun `liftM` unVar' ct
+    unVar' (CTCompose c1 c2) = liftM2 CTCompose (unVar' c1) (unVar' c2)
+    unVar' x = return x