[project @ 1996-07-19 18:36:04 by partain]
[ghc-hetmet.git] / ghc / compiler / hsSyn / HsDecls.lhs
index 68b1a87..6341f66 100644 (file)
@@ -11,12 +11,13 @@ Definitions for: @FixityDecl@, @TyDecl@ and @ConDecl@, @ClassDecl@,
 
 module HsDecls where
 
-import Ubiq
+IMP_Ubiq()
 
 -- friends:
-import HsLoop          ( nullMonoBinds, MonoBinds, Sig )
+IMPORT_DELOOPER(HsLoop)                ( nullMonoBinds, MonoBinds, Sig )
 import HsPragmas       ( DataPragmas, ClassPragmas,
-                         InstancePragmas, ClassOpPragmas )
+                         InstancePragmas, ClassOpPragmas
+                       )
 import HsTypes
 
 -- others:
@@ -26,7 +27,7 @@ import Outputable     ( interppSP, interpp'SP,
                        )
 import Pretty
 import SrcLoc          ( SrcLoc )
-import Util            ( cmpList, panic#{-ToDo:rm eventually-} )
+--import Util          ( panic#{-ToDo:rm eventually-} )
 \end{code}
 
 %************************************************************************
@@ -167,8 +168,8 @@ data ConDecl name
                SrcLoc
 
 data BangType name
-  = Banged   (MonoType name)
-  | Unbanged (MonoType name)
+  = Banged   (PolyType name)   -- PolyType: to allow Haskell extensions
+  | Unbanged (PolyType name)   -- (MonoType only needed for straight Haskell)
 \end{code}
 
 \begin{code}
@@ -186,8 +187,8 @@ instance (NamedThing name, Outputable name) => Outputable (ConDecl name) where
       where
        pp_field (n, ty) = ppCat [ppr sty n, ppPStr SLIT("::"), ppr_bang sty ty]
 
-ppr_bang sty (Banged   ty) = ppBeside (ppChar '!') (pprParendMonoType sty ty)
-ppr_bang sty (Unbanged ty) = pprParendMonoType sty ty
+ppr_bang sty (Banged   ty) = ppBeside (ppChar '!') (pprParendPolyType sty ty)
+ppr_bang sty (Unbanged ty) = pprParendPolyType sty ty
 \end{code}
 
 %************************************************************************
@@ -246,8 +247,8 @@ data InstDecl tyvar uvar name pat
                                -- module being compiled; False <=> It is from
                                -- an imported interface.
 
-               (Maybe Module)  -- The name of the module where the instance decl
-                               -- originally came from; Nothing => Prelude
+               Module          -- The name of the module where the instance decl
+                               -- originally came from
 
                [Sig name]              -- actually user-supplied pragmatic info
                (InstancePragmas name)  -- interface-supplied pragmatic info
@@ -259,7 +260,7 @@ instance (NamedThing name, Outputable name, Outputable pat,
          Eq tyvar, Outputable tyvar, Eq uvar, Outputable uvar)
              => Outputable (InstDecl tyvar uvar name pat) where
 
-    ppr sty (InstDecl clas ty binds local modname uprags pragmas src_loc)
+    ppr sty (InstDecl clas ty binds from_here modname uprags pragmas src_loc)
       = let
            (context, inst_ty)
              = case ty of