lots of portability changes (#1405)
[ghc-hetmet.git] / compiler / hsSyn / HsDecls.lhs
index fb6370a..b9f0997 100644 (file)
@@ -9,6 +9,13 @@ Definitions for: @TyDecl@ and @oCnDecl@, @ClassDecl@,
 @InstDecl@, @DefaultDecl@ and @ForeignDecl@.
 
 \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/Commentary/CodingStyle#Warnings
+-- for details
+
 module HsDecls (
        HsDecl(..), LHsDecl, TyClDecl(..), LTyClDecl, 
        InstDecl(..), LInstDecl, DerivDecl(..), LDerivDecl, NewOrData(..),
@@ -399,8 +406,10 @@ data TyClDecl name
                        -- instance' decl with explicit kind sig
 
                tcdCons   :: [LConDecl name],           -- Data constructors
-                       -- For data T a = T1 | T2 a          the LConDecls all have ResTyH98
-                       -- For data T a where { T1 :: T a }  the LConDecls all have ResTyGADT
+                       -- For data T a = T1 | T2 a          
+                        --   the LConDecls all have ResTyH98
+                       -- For data T a where { T1 :: T a }  
+                        --   the LConDecls all have ResTyGADT
 
                tcdDerivs :: Maybe [LHsType name]
                        -- Derivings; Nothing => not specified
@@ -427,9 +436,9 @@ data TyClDecl name
                tcdSigs    :: [LSig name],              -- Methods' signatures
                tcdMeths   :: LHsBinds name,            -- Default methods
                tcdATs     :: [LTyClDecl name],         -- Associated types; ie
-                                                       --   only 'TyData',
-                                                       --   'TyFunction',
-                                                       --   and 'TySynonym'
+                                                       --   only 'TyFamily' and
+                                                       --   'TySynonym'; the
+                                                        --   latter for defaults
                tcdDocs    :: [LDocDecl name]           -- Haddock docs
     }
 
@@ -676,7 +685,7 @@ data ResType name
 \end{code}
 
 \begin{code}
-conDeclsNames :: forall name. Eq name => [ConDecl name] -> [Located name]
+conDeclsNames :: (Eq name) => [ConDecl name] -> [Located name]
   -- See tyClDeclNames for what this does
   -- The function is boringly complicated because of the records
   -- And since we only have equality, we have to be a little careful
@@ -743,10 +752,10 @@ data InstDecl name
 instance (OutputableBndr name) => Outputable (InstDecl name) where
 
     ppr (InstDecl inst_ty binds uprags ats)
-      = vcat [hsep [ptext SLIT("instance"), ppr inst_ty, ptext SLIT("where")],
-             nest 4 (ppr ats),
-             nest 4 (ppr uprags),
-             nest 4 (pprLHsBinds binds) ]
+      = vcat [hsep [ptext SLIT("instance"), ppr inst_ty, ptext SLIT("where")]
+             , nest 4 $ vcat (map ppr ats)
+            , nest 4 $ vcat (map ppr uprags)
+            , nest 4 $ pprLHsBinds binds ]
 
 -- Extract the declarations of associated types from an instance
 --