2 % (c) The GRASP/AQUA Project, Glasgow University, 1997-1998
4 \section[BasicTypes]{Miscellanous types}
6 This module defines a miscellaneously collection of very simple
10 \item have no other obvious home
11 \item don't depend on any other complicated types
12 \item are used in more than one "part" of the compiler
19 Fixity(..), FixityDirection(..), StrictnessMark(..),
20 NewOrData(..), TopLevelFlag(..), RecFlag(..)
23 #include "HsVersions.h"
28 %************************************************************************
30 \subsection[Unused]{Unused}
32 %************************************************************************
34 Used as a placeholder in types.
40 unused = error "Unused is used!"
44 %************************************************************************
46 \subsection[Arity]{Arity}
48 %************************************************************************
55 %************************************************************************
57 \subsection[Version]{Module and identifier version numbers}
59 %************************************************************************
66 %************************************************************************
68 \subsection[Fixity]{Fixity info}
70 %************************************************************************
73 data Fixity = Fixity Int FixityDirection
74 data FixityDirection = InfixL | InfixR | InfixN
77 instance Outputable Fixity where
78 ppr (Fixity prec dir) = hcat [ppr dir, space, int prec]
80 instance Outputable FixityDirection where
81 ppr InfixL = ptext SLIT("infixl")
82 ppr InfixR = ptext SLIT("infixr")
83 ppr InfixN = ptext SLIT("infix")
85 instance Eq Fixity where -- Used to determine if two fixities conflict
86 (Fixity p1 dir1) == (Fixity p2 dir2) = p1==p2 && dir1 == dir2
90 %************************************************************************
92 \subsection[NewType/DataType]{NewType/DataType flag}
94 %************************************************************************
98 = NewType -- "newtype Blah ..."
99 | DataType -- "data Blah ..."
100 | EnumType -- Enumeration; all constructors are nullary
101 deriving( Eq ) -- Needed because Demand derives Eq
104 The @RecFlag@ tells whether the thing is part of a recursive group or not.
107 %************************************************************************
109 \subsection[Top-level/local]{Top-level/not-top level flag}
111 %************************************************************************
120 %************************************************************************
122 \subsection[Top-level/local]{Top-level/not-top level flag}
124 %************************************************************************
127 data RecFlag = Recursive
131 %************************************************************************
133 \subsection{Strictness indication}
135 %************************************************************************
138 data StrictnessMark = MarkedStrict