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:
)
import Pretty
import SrcLoc ( SrcLoc )
-import Util ( cmpList, panic#{-ToDo:rm eventually-} )
+import Util ( panic#{-ToDo:rm eventually-} )
\end{code}
%************************************************************************
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}
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}
%************************************************************************
-- 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