2 % (c) The GRASP/AQUA Project, Glasgow University, 1997
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
16 #include "HsVersions.h"
19 SYN_IE(Version), SYN_IE(Arity),
20 SYN_IE(Module), moduleString, pprModule,
21 Fixity(..), FixityDirection(..),
32 %************************************************************************
34 \subsection[Arity]{Arity}
36 %************************************************************************
43 %************************************************************************
45 \subsection[Version]{Module and identifier version numbers}
47 %************************************************************************
54 %************************************************************************
56 \subsection[Module]{The name of a module}
58 %************************************************************************
61 type Module = FAST_STRING
63 moduleString :: Module -> String
64 moduleString mod = _UNPK_ mod
66 pprModule :: PprStyle -> Module -> Doc
67 pprModule sty m = ptext m
71 %************************************************************************
73 \subsection[Fixity]{Fixity info}
75 %************************************************************************
78 data Fixity = Fixity Int FixityDirection
79 data FixityDirection = InfixL | InfixR | InfixN
82 instance Outputable Fixity where
83 ppr sty (Fixity prec dir) = hcat [ppr sty dir, space, int prec]
85 instance Outputable FixityDirection where
86 ppr sty InfixL = ptext SLIT("infixl")
87 ppr sty InfixR = ptext SLIT("infixr")
88 ppr sty InfixN = ptext SLIT("infix")
90 instance Eq Fixity where -- Used to determine if two fixities conflict
91 (Fixity p1 dir1) == (Fixity p2 dir2) = p1==p2 && dir1 == dir2
95 %************************************************************************
97 \subsection[NewType/DataType]{NewType/DataType flag}
99 %************************************************************************
103 = NewType -- "newtype Blah ..."
104 | DataType -- "data Blah ..."