%
-% (c) The GRASP/AQUA Project, Glasgow University, 1997
+% (c) The GRASP/AQUA Project, Glasgow University, 1997-1998
%
\section[BasicTypes]{Miscellanous types}
\end{itemize}
\begin{code}
-#include "HsVersions.h"
-
module BasicTypes(
- SYN_IE(Version), SYN_IE(Arity),
- SYN_IE(Module), moduleString, pprModule,
- Fixity(..), FixityDirection(..),
- NewOrData(..)
+ Version, Arity,
+ Unused, unused,
+ Fixity(..), FixityDirection(..), StrictnessMark(..),
+ NewOrData(..), TopLevelFlag(..), RecFlag(..)
) where
-IMP_Ubiq()
+#include "HsVersions.h"
-import Pretty
import Outputable
-
\end{code}
%************************************************************************
%* *
-\subsection[Arity]{Arity}
+\subsection[Unused]{Unused}
%* *
%************************************************************************
+Used as a placeholder in types.
+
\begin{code}
-type Arity = Int
+type Unused = ()
+
+unused :: Unused
+unused = error "Unused is used!"
\end{code}
%************************************************************************
%* *
-\subsection[Version]{Module and identifier version numbers}
+\subsection[Arity]{Arity}
%* *
%************************************************************************
\begin{code}
-type Version = Int
+type Arity = Int
\end{code}
%************************************************************************
%* *
-\subsection[Module]{The name of a module}
+\subsection[Version]{Module and identifier version numbers}
%* *
%************************************************************************
\begin{code}
-type Module = FAST_STRING
-
-moduleString :: Module -> String
-moduleString mod = _UNPK_ mod
-
-pprModule :: PprStyle -> Module -> Doc
-pprModule sty m = ptext m
+type Version = Int
\end{code}
deriving(Eq)
instance Outputable Fixity where
- ppr sty (Fixity prec dir) = hcat [ppr sty dir, space, int prec]
+ ppr (Fixity prec dir) = hcat [ppr dir, space, int prec]
instance Outputable FixityDirection where
- ppr sty InfixL = ptext SLIT("infixl")
- ppr sty InfixR = ptext SLIT("infixr")
- ppr sty InfixN = ptext SLIT("infix")
+ ppr InfixL = ptext SLIT("infixl")
+ ppr InfixR = ptext SLIT("infixr")
+ ppr InfixN = ptext SLIT("infix")
instance Eq Fixity where -- Used to determine if two fixities conflict
(Fixity p1 dir1) == (Fixity p2 dir2) = p1==p2 && dir1 == dir2
\begin{code}
data NewOrData
- = NewType -- "newtype Blah ..."
- | DataType -- "data Blah ..."
- deriving( Eq )
+ = NewType -- "newtype Blah ..."
+ | DataType -- "data Blah ..."
+ | EnumType -- Enumeration; all constructors are nullary
+ deriving( Eq ) -- Needed because Demand derives Eq
+\end{code}
+
+The @RecFlag@ tells whether the thing is part of a recursive group or not.
+
+
+%************************************************************************
+%* *
+\subsection[Top-level/local]{Top-level/not-top level flag}
+%* *
+%************************************************************************
+
+\begin{code}
+data TopLevelFlag
+ = TopLevel
+ | NotTopLevel
+\end{code}
+
+
+%************************************************************************
+%* *
+\subsection[Top-level/local]{Top-level/not-top level flag}
+%* *
+%************************************************************************
+
+\begin{code}
+data RecFlag = Recursive
+ | NonRecursive
+\end{code}
+
+%************************************************************************
+%* *
+\subsection{Strictness indication}
+%* *
+%************************************************************************
+
+\begin{code}
+data StrictnessMark = MarkedStrict
+ | NotMarkedStrict
\end{code}