Do dependency analysis when kind-checking type declarations
[ghc-hetmet.git] / compiler / hsSyn / HsDecls.lhs
index dff8ce7..8827f3a 100644 (file)
@@ -126,7 +126,12 @@ data HsDecl id
 data HsGroup id
   = HsGroup {
        hs_valds  :: HsValBinds id,
-       hs_tyclds :: [LTyClDecl id],
+
+       hs_tyclds :: [[LTyClDecl id]],  
+               -- A list of mutually-recursive groups
+               -- Parser generates a singleton list;
+               -- renamer does dependency analysis
+
        hs_instds :: [LInstDecl id],
         hs_derivds :: [LDerivDecl id],
 
@@ -228,10 +233,12 @@ instance OutputableBndr name => Outputable (HsGroup name) where
             if isEmptyValBinds val_decls 
                 then Nothing 
                 else Just (ppr val_decls),
-            ppr_ds tycl_decls, ppr_ds inst_decls,
+            ppr_ds (concat tycl_decls), 
+             ppr_ds inst_decls,
              ppr_ds deriv_decls,
             ppr_ds foreign_decls]
        where
+          ppr_ds :: Outputable a => [a] -> Maybe SDoc
          ppr_ds [] = Nothing
          ppr_ds ds = Just (vcat (map ppr ds))
 
@@ -636,6 +643,7 @@ instance OutputableBndr name
         top_matter    =     ptext (sLit "class") 
                        <+> pp_decl_head (unLoc context) lclas tyvars Nothing
                        <+> pprFundeps (map unLoc fds)
+        ppr_semi :: Outputable a => a -> SDoc
        ppr_semi decl = ppr decl <> semi
 
 pp_decl_head :: OutputableBndr name
@@ -895,7 +903,7 @@ data ForeignImport = -- import of a C entity
                     --  * `Safety' is irrelevant for `CLabel' and `CWrapper'
                     --
                     CImport  CCallConv       -- ccall or stdcall
-                             Safety          -- safe or unsafe
+                             Safety          -- interruptible, safe or unsafe
                              FastString      -- name of C header
                              CImportSpec     -- details of the C entity
   deriving (Data, Typeable)