[project @ 2001-05-08 14:39:27 by simonpj]
[ghc-hetmet.git] / ghc / compiler / hsSyn / HsMatches.lhs
index 7fe648d..cb81b7c 100644 (file)
@@ -13,13 +13,12 @@ module HsMatches where
 -- Friends
 import HsExpr          ( HsExpr, Stmt(..) )
 import HsBinds         ( HsBinds(..), nullBinds )
-import HsTypes         ( HsTyVar, HsType )
-
+import HsTypes         ( HsType )
 -- Others
 import Type            ( Type )
 import SrcLoc          ( SrcLoc )
 import Outputable
-import Name            ( NamedThing )
+import List
 \end{code}
 
 %************************************************************************
@@ -45,11 +44,11 @@ patterns in each equation.
 \begin{code}
 data Match id pat
   = Match
-       [HsTyVar id]                    -- Tyvars wrt which this match is universally quantified
-                                       --      emtpy after typechecking
-       [pat]                           -- The patterns
-       (Maybe (HsType id))             -- A type signature for the result of the match
-                                       --      Nothing after typechecking
+       [id]                    -- Tyvars wrt which this match is universally quantified
+                               -- empty after typechecking
+       [pat]                   -- The patterns
+       (Maybe (HsType id))     -- A type signature for the result of the match
+                               --      Nothing after typechecking
 
        (GRHSs id pat)
 
@@ -90,12 +89,12 @@ getMatchLoc (Match _ _ _ (GRHSs (GRHS _ loc : _) _ _)) = loc
 
 We know the list must have at least one @Match@ in it.
 \begin{code}
-pprMatches :: (NamedThing id, Outputable id, Outputable pat)
+pprMatches :: (Outputable id, Outputable pat)
           => (Bool, SDoc) -> [Match id pat] -> SDoc
 pprMatches print_info matches = vcat (map (pprMatch print_info) matches)
 
 
-pprMatch :: (NamedThing id, Outputable id, Outputable pat)
+pprMatch :: (Outputable id, Outputable pat)
           => (Bool, SDoc) -> Match id pat -> SDoc
 pprMatch print_info@(is_case, name) (Match _ pats maybe_ty grhss)
   = maybe_name <+> sep [sep (map ppr pats), 
@@ -109,7 +108,7 @@ pprMatch print_info@(is_case, name) (Match _ pats maybe_ty grhss)
                        Nothing -> empty
 
 
-pprGRHSs :: (NamedThing id, Outputable id, Outputable pat)
+pprGRHSs :: (Outputable id, Outputable pat)
         => Bool -> GRHSs id pat -> SDoc
 pprGRHSs is_case (GRHSs grhss binds maybe_ty)
   = vcat (map (pprGRHS is_case) grhss)
@@ -118,7 +117,7 @@ pprGRHSs is_case (GRHSs grhss binds maybe_ty)
      else text "where" $$ nest 4 (pprDeeper (ppr binds)))
 
 
-pprGRHS :: (NamedThing id, Outputable id, Outputable pat)
+pprGRHS :: (Outputable id, Outputable pat)
        => Bool -> GRHS id pat -> SDoc
 
 pprGRHS is_case (GRHS [ExprStmt expr _] locn)
@@ -132,3 +131,4 @@ pprGRHS is_case (GRHS guarded locn)
     ExprStmt expr _ = last guarded     -- Last stmt should be a ExprStmt for guards
     guards         = init guarded
 \end{code}
+