Don't import FastString in HsVersions.h
[ghc-hetmet.git] / compiler / deSugar / MatchCon.lhs
index bd4a9b7..4e9ee8e 100644 (file)
@@ -6,11 +6,11 @@
 Pattern-matching constructors
 
 \begin{code}
-{-# OPTIONS_GHC -w #-}
+{-# OPTIONS -fno-warn-incomplete-patterns #-}
 -- 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/WorkingConventions#Warnings
+--     http://hackage.haskell.org/trac/ghc/wiki/Commentary/CodingStyle#Warnings
 -- for details
 
 module MatchCon ( matchConFamily ) where
@@ -29,6 +29,7 @@ import DsMonad
 import DsUtils
 import Util    ( takeList )
 import Id
+import Var      (TyVar)
 import SrcLoc
 import Outputable
 \end{code}
@@ -93,6 +94,10 @@ matchConFamily (var:vars) ty groups
   = do { alts <- mapM (matchOneCon vars ty) groups
        ; return (mkCoAlgCaseMatchResult var ty alts) }
 
+matchOneCon :: [Id]
+            -> Type
+            -> [EquationInfo]
+            -> DsM (DataCon, [TyVar], MatchResult)
 matchOneCon vars ty (eqn1 : eqns)      -- All eqns for a single constructor
   = do { (wraps, eqns') <- mapAndUnzipM shift (eqn1:eqns)
        ; arg_vars <- selectMatchVars (take (dataConSourceArity con1) 
@@ -128,9 +133,9 @@ conArgPats :: DataCon
                        -- are probably never looked at anyway
           -> HsConDetails (LPat Id) (HsRecFields Id (LPat Id))
           -> [Pat Id]
-conArgPats data_con arg_tys (PrefixCon ps)   = map unLoc ps
-conArgPats data_con arg_tys (InfixCon p1 p2) = [unLoc p1, unLoc p2]
-conArgPats data_con arg_tys (RecCon (HsRecFields rpats _))
+conArgPats _data_con _arg_tys (PrefixCon ps)   = map unLoc ps
+conArgPats _data_con _arg_tys (InfixCon p1 p2) = [unLoc p1, unLoc p2]
+conArgPats  data_con  arg_tys (RecCon (HsRecFields rpats _))
   | null rpats
   =    -- Special case for C {}, which can be used for 
        -- a constructor that isn't declared to have