X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Fcompiler%2Ftypecheck%2FTcRnTypes.lhs;fp=ghc%2Fcompiler%2Ftypecheck%2FTcRnTypes.lhs;h=308a884915f3addcc3ccf7f42ed92ab2fb670068;hb=cb205eb46927f79850b89b5598989ca86a168c18;hp=ece741f42dad96b7ff93ffd55c8230194673fc03;hpb=0ac48591aba492239104c2d510f5b57bfc4d3530;p=ghc-hetmet.git diff --git a/ghc/compiler/typecheck/TcRnTypes.lhs b/ghc/compiler/typecheck/TcRnTypes.lhs index ece741f..308a884 100644 --- a/ghc/compiler/typecheck/TcRnTypes.lhs +++ b/ghc/compiler/typecheck/TcRnTypes.lhs @@ -27,7 +27,7 @@ module TcRnTypes( ThLevel, impLevel, topLevel, -- Arrows - newArrowScope, escapeArrowScope, + ArrowCtxt(NoArrowCtxt), newArrowScope, escapeArrowScope, -- Insts Inst(..), InstOrigin(..), InstLoc(..), pprInstLoc, @@ -394,7 +394,9 @@ and returning to that (using escapeArrowScope) on the left of -< and the head of (|..|). -} -newtype ArrowCtxt = ArrowCtxt { arr_proc_env :: Env TcGblEnv TcLclEnv } +data ArrowCtxt + = NoArrowCtxt + | ArrowCtxt (Env TcGblEnv TcLclEnv) -- Record the current environment (outside a proc) newArrowScope :: TcM a -> TcM a @@ -404,7 +406,10 @@ newArrowScope -- Return to the stored environment (from the enclosing proc) escapeArrowScope :: TcM a -> TcM a -escapeArrowScope = updEnv (arr_proc_env . tcl_arrow_ctxt . env_lcl) +escapeArrowScope + = updEnv $ \ env -> case tcl_arrow_ctxt (env_lcl env) of + NoArrowCtxt -> env + ArrowCtxt env' -> env' --------------------------- -- TcTyThing