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"
25 import {-# SOURCE #-} DataCon ( DataCon )
26 import {-# SOURCE #-} Type ( Type )
30 %************************************************************************
32 \subsection[Unused]{Unused}
34 %************************************************************************
36 Used as a placeholder in types.
42 unused = error "Unused is used!"
46 %************************************************************************
48 \subsection[Arity]{Arity}
50 %************************************************************************
57 %************************************************************************
59 \subsection[Version]{Module and identifier version numbers}
61 %************************************************************************
68 %************************************************************************
70 \subsection[Fixity]{Fixity info}
72 %************************************************************************
75 data Fixity = Fixity Int FixityDirection
76 data FixityDirection = InfixL | InfixR | InfixN
79 instance Outputable Fixity where
80 ppr (Fixity prec dir) = hcat [ppr dir, space, int prec]
82 instance Outputable FixityDirection where
83 ppr InfixL = ptext SLIT("infixl")
84 ppr InfixR = ptext SLIT("infixr")
85 ppr InfixN = ptext SLIT("infix")
87 instance Eq Fixity where -- Used to determine if two fixities conflict
88 (Fixity p1 dir1) == (Fixity p2 dir2) = p1==p2 && dir1 == dir2
92 %************************************************************************
94 \subsection[NewType/DataType]{NewType/DataType flag}
96 %************************************************************************
100 = NewType -- "newtype Blah ..."
101 | DataType -- "data Blah ..."
102 | EnumType -- Enumeration; all constructors are nullary
103 deriving( Eq ) -- Needed because Demand derives Eq
106 %************************************************************************
108 \subsection[Top-level/local]{Top-level/not-top level flag}
110 %************************************************************************
118 %************************************************************************
120 \subsection[Recursive/Non-Recursive]{Recursive/Non-Recursive flag}
122 %************************************************************************
125 data RecFlag = Recursive
129 %************************************************************************
131 \subsection{Strictness indication}
133 %************************************************************************
136 data StrictnessMark = MarkedStrict
137 | MarkedUnboxed DataCon [Type]