[project @ 2000-12-08 12:02:25 by simonpj]
[ghc-hetmet.git] / ghc / compiler / hsSyn / HsSyn.lhs
index ed94533..f2ad080 100644 (file)
@@ -10,7 +10,7 @@ therefore, is almost nothing but re-exporting.
 \begin{code}
 module HsSyn (
 
-       -- NB: don't reexport HsCore or HsPragmas;
+       -- NB: don't reexport HsCore
        -- this module tells about "real Haskell"
 
        module HsSyn,
@@ -24,7 +24,8 @@ module HsSyn (
        module HsTypes,
        Fixity, NewOrData, 
 
-       collectTopBinders, collectMonoBinders, collectLocatedMonoBinders
+       collectTopBinders, collectMonoBinders, collectLocatedMonoBinders,
+       hsModuleName, hsModuleImports
      ) where
 
 #include "HsVersions.h"
@@ -38,10 +39,10 @@ import HsLit
 import HsMatches
 import HsPat
 import HsTypes
-import HsCore
 import BasicTypes      ( Fixity, Version, NewOrData )
 
 -- others:
+import Name            ( NamedThing )
 import Outputable
 import SrcLoc          ( SrcLoc )
 import Bag
@@ -67,7 +68,7 @@ data HsModule name pat
 \end{code}
 
 \begin{code}
-instance (Outputable name, Outputable pat)
+instance (NamedThing name, Outputable name, Outputable pat)
        => Outputable (HsModule name pat) where
 
     ppr (HsModule name iface_version exports imports
@@ -92,6 +93,9 @@ instance (Outputable name, Outputable pat)
 
        pp_nonnull [] = empty
        pp_nonnull xs = vcat (map ppr xs)
+
+hsModuleName    (HsModule mod_name _ _ _ _ _ _) = mod_name
+hsModuleImports (HsModule mod_name vers exports imports decls deprec src_loc) = imports
 \end{code}