[project @ 1997-03-14 07:52:06 by simonpj]
[ghc-hetmet.git] / ghc / compiler / prelude / PrelMods.lhs
1 %
2 % (c) The GRASP/AQUA Project, Glasgow University, 1992-1996
3 %
4 \section[PrelMods]{Definitions of prelude modules}
5
6 The strings identify built-in prelude modules.  They are
7 defined here so as to avod 
8
9 [oh dear, look like the recursive module monster caught up and
10  gobbled whoever was writing the above :-) -- SOF ]
11
12 \begin{code}
13 #include "HsVersions.h"
14
15 module PrelMods
16         (
17          isPreludeModule,   -- :: Module -> Bool
18
19          gHC__, pRELUDE, pREL_BASE,
20          pREL_READ , pREL_NUM, pREL_LIST,
21          pREL_TUP  , pACKED_STRING, cONC_BASE,
22          iO_BASE   , mONAD, rATIO, iX,
23          sT_BASE   , aRR_BASE, fOREIGN, mAIN,
24          gHC_MAIN  , gHC_ERR
25         ) where
26
27 CHK_Ubiq() -- debugging consistency check
28 import UniqSet ( UniqSet(..), mkUniqSet, elementOfUniqSet )
29
30 \end{code}
31
32 Predicate used by RnIface to decide whether or not to
33 append a special suffix for prelude modules:
34
35 \begin{code}
36 isPreludeModule :: Module -> Bool
37 isPreludeModule mod = mod `elementOfUniqSet` preludeNames
38
39 preludeNames :: UniqSet FAST_STRING
40 preludeNames =
41  mkUniqSet
42    [ gHC__
43    , pRELUDE   , pREL_BASE
44    , pREL_READ , pREL_NUM
45    , pREL_LIST , pREL_TUP
46    , pACKED_STRING  , cONC_BASE
47    , iO_BASE   , mONAD
48    , rATIO     , iX
49    , sT_BASE   , aRR_BASE
50    , fOREIGN   , mAIN
51    , gHC_MAIN  , gHC_ERR
52    ]
53 \end{code}
54
55 \begin{code}
56 gHC__        = SLIT("GHC")         -- Primitive types and values
57
58 pRELUDE      = SLIT("Prelude")
59 pREL_BASE    = SLIT("PrelBase")
60 pREL_READ    = SLIT("PrelRead")
61 pREL_NUM     = SLIT("PrelNum")
62 pREL_LIST    = SLIT("PrelList")
63 pREL_TUP     = SLIT("PrelTup")
64 pACKED_STRING= SLIT("PackedString")
65 cONC_BASE    = SLIT("ConcBase")
66 iO_BASE      = SLIT("IOBase")
67 mONAD        = SLIT("Monad")
68 rATIO        = SLIT("Ratio")
69 iX           = SLIT("Ix")
70 sT_BASE      = SLIT("STBase")
71 aRR_BASE     = SLIT("ArrBase")
72 fOREIGN      = SLIT("Foreign")
73
74 mAIN         = SLIT("Main")
75 gHC_MAIN     = SLIT("GHCmain")
76 gHC_ERR      = SLIT("GHCerr")
77
78
79
80 \end{code}