X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=blobdiff_plain;f=compiler%2Ftypecheck%2FTcArrows.lhs;h=efd01c904fd99071a2728e4e7b895f76f965b35a;hp=b53b5ea82156ab7d7857a9eb4302ee6a3aa8f654;hb=ad94d40948668032189ad22a0ad741ac1f645f50;hpb=e6d057711f4d6d6ff6342c39fa2b9e44d25447f1 diff --git a/compiler/typecheck/TcArrows.lhs b/compiler/typecheck/TcArrows.lhs index b53b5ea..efd01c9 100644 --- a/compiler/typecheck/TcArrows.lhs +++ b/compiler/typecheck/TcArrows.lhs @@ -1,9 +1,17 @@ % +% (c) The University of Glasgow 2006 % (c) The GRASP/AQUA Project, Glasgow University, 1992-1998 % -\section{Typecheck arrow notation} +Typecheck arrow notation \begin{code} +{-# OPTIONS -w #-} +-- The above warning supression flag is a temporary kludge. +-- While working on this module you are encouraged to remove it and fix +-- any warnings in the module. See +-- http://hackage.haskell.org/trac/ghc/wiki/CodingStyle#Warnings +-- for details + module TcArrows ( tcProc ) where #include "HsVersions.h" @@ -11,32 +19,28 @@ module TcArrows ( tcProc ) where import {-# SOURCE #-} TcExpr( tcMonoExpr, tcInferRho ) import HsSyn -import TcHsSyn ( mkHsDictLet ) - -import TcMatches ( matchCtxt, tcStmts, tcMDoStmt, tcGuardStmt, - TcMatchCtxt(..), tcMatchesCase ) - -import TcType ( TcType, TcTauType, BoxyRhoType, mkFunTys, mkTyConApp, - mkTyVarTy, mkAppTys, tcSplitTyConApp_maybe, tcEqType, - SkolemInfo(..) ) -import TcMType ( newFlexiTyVarTy, tcInstSkolTyVars, zonkTcType ) -import TcBinds ( tcLocalBinds ) -import TcSimplify ( tcSimplifyCheck ) -import TcGadt ( Refinement, emptyRefinement, refineResType ) -import TcPat ( tcLamPat, tcLamPats ) -import TcUnify ( checkSigTyVarsWrt, boxySplitAppTy ) +import TcHsSyn + +import TcMatches + +import TcType +import TcMType +import TcBinds +import TcSimplify +import TcGadt +import TcPat +import TcUnify import TcRnMonad -import Inst ( tcSyntaxName ) -import Name ( Name ) -import TysWiredIn ( boolTy, pairTyCon ) +import Inst +import Name +import TysWiredIn import VarSet -import TysPrim ( alphaTyVar ) -import Type ( Kind, mkArrowKinds, liftedTypeKind, openTypeKind, tyVarsOfTypes ) +import TysPrim +import Type -import SrcLoc ( Located(..), noLoc, unLoc ) +import SrcLoc import Outputable -import Util ( lengthAtLeast ) - +import Util \end{code} %************************************************************************ @@ -241,7 +245,7 @@ tc_cmd env cmd@(HsArrForm expr fixity cmd_args) (cmd_stk, res_ty) = addErrCtxt (cmdCtxt cmd) $ do { cmds_w_tys <- zipWithM new_cmd_ty cmd_args [1..] ; span <- getSrcSpanM - ; [w_tv] <- tcInstSkolTyVars (ArrowSkol span) [alphaTyVar] + ; [w_tv] <- tcInstSkolTyVars ArrowSkol [alphaTyVar] ; let w_ty = mkTyVarTy w_tv -- Just a convenient starting point -- a ((w,t1) .. tn) t @@ -254,7 +258,8 @@ tc_cmd env cmd@(HsArrForm expr fixity cmd_args) (cmd_stk, res_ty) -- Check expr ; (expr', lie) <- escapeArrowScope (getLIE (tcMonoExpr expr e_ty)) - ; inst_binds <- tcSimplifyCheck sig_msg [w_tv] [] lie + ; loc <- getInstLoc (SigOrigin ArrowSkol) + ; inst_binds <- tcSimplifyCheck loc [w_tv] [] lie -- Check that the polymorphic variable hasn't been unified with anything -- and is not free in res_ty or the cmd_stk (i.e. t, t1..tn) @@ -306,8 +311,6 @@ tc_cmd env cmd@(HsArrForm expr fixity cmd_args) (cmd_stk, res_ty) other -> (ty, []) - sig_msg = ptext SLIT("expected type of a command form") - ----------------------------------------------------------------- -- Base case for illegal commands -- This is where expressions that aren't commands get rejected