summaryrefslogtreecommitdiff
path: root/compiler/prelude/PrelInfo.lhs
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/prelude/PrelInfo.lhs')
-rw-r--r--compiler/prelude/PrelInfo.lhs64
1 files changed, 29 insertions, 35 deletions
diff --git a/compiler/prelude/PrelInfo.lhs b/compiler/prelude/PrelInfo.lhs
index 014e0e7483..eaefff2364 100644
--- a/compiler/prelude/PrelInfo.lhs
+++ b/compiler/prelude/PrelInfo.lhs
@@ -4,13 +4,7 @@
\section[PrelInfo]{The @PrelInfo@ interface to the compiler's prelude knowledge}
\begin{code}
-{-# OPTIONS -fno-warn-tabs #-}
--- The above warning supression flag is a temporary kludge.
--- While working on this module you are encouraged to remove it and
--- detab the module (please do the detabbing in a separate patch). See
--- http://ghc.haskell.org/trac/ghc/wiki/Commentary/CodingStyle#TabsvsSpaces
--- for details
-
+{-# LANGUAGE CPP #-}
module PrelInfo (
wiredInIds, ghcPrimIds,
primOpRules, builtinRules,
@@ -18,7 +12,7 @@ module PrelInfo (
ghcPrimExports,
wiredInThings, basicKnownKeyNames,
primOpId,
-
+
-- Random other things
maybeCharLikeCon, maybeIntLikeCon,
@@ -48,9 +42,9 @@ import Data.Array
\end{code}
%************************************************************************
-%* *
+%* *
\subsection[builtinNameInfo]{Lookup built-in names}
-%* *
+%* *
%************************************************************************
Notes about wired in things
@@ -58,13 +52,13 @@ Notes about wired in things
* Wired-in things are Ids\/TyCons that are completely known to the compiler.
They are global values in GHC, (e.g. listTyCon :: TyCon).
-* A wired in Name contains the thing itself inside the Name:
- see Name.wiredInNameTyThing_maybe
- (E.g. listTyConName contains listTyCon.
+* A wired in Name contains the thing itself inside the Name:
+ see Name.wiredInNameTyThing_maybe
+ (E.g. listTyConName contains listTyCon.
* The name cache is initialised with (the names of) all wired-in things
-* The type checker sees if the Name is wired in before looking up
+* The type checker sees if the Name is wired in before looking up
the name in the type environment. So the type envt itself contains
no wired in things.
@@ -77,17 +71,17 @@ wiredInThings :: [TyThing]
-- This list is used only to initialise HscMain.knownKeyNames
-- to ensure that when you say "Prelude.map" in your source code, you
-- get a Name with the correct known key (See Note [Known-key names])
-wiredInThings
+wiredInThings
= concat
- [ -- Wired in TyCons and their implicit Ids
- tycon_things
- , concatMap implicitTyThings tycon_things
+ [ -- Wired in TyCons and their implicit Ids
+ tycon_things
+ , concatMap implicitTyThings tycon_things
- -- Wired in Ids
- , map AnId wiredInIds
+ -- Wired in Ids
+ , map AnId wiredInIds
- -- PrimOps
- , map (AnId . primOpId) allThePrimOps
+ -- PrimOps
+ , map (AnId . primOpId) allThePrimOps
]
where
tycon_things = map ATyCon ([funTyCon] ++ primTyCons ++ wiredInTyCons
@@ -99,16 +93,16 @@ sense of them in interface pragmas. It's cool, though they all have
"non-standard" names, so they won't get past the parser in user code.
%************************************************************************
-%* *
- PrimOpIds
-%* *
+%* *
+ PrimOpIds
+%* *
%************************************************************************
\begin{code}
-primOpIds :: Array Int Id
+primOpIds :: Array Int Id
-- A cache of the PrimOp Ids, indexed by PrimOp tag
-primOpIds = array (1,maxPrimOpTag) [ (primOpTag op, mkPrimOpId op)
- | op <- allThePrimOps ]
+primOpIds = array (1,maxPrimOpTag) [ (primOpTag op, mkPrimOpId op)
+ | op <- allThePrimOps ]
primOpId :: PrimOp -> Id
primOpId op = primOpIds ! primOpTag op
@@ -116,9 +110,9 @@ primOpId op = primOpIds ! primOpTag op
%************************************************************************
-%* *
+%* *
\subsection{Export lists for pseudo-modules (GHC.Prim)}
-%* *
+%* *
%************************************************************************
GHC.Prim "exports" all the primops and primitive types, some
@@ -129,16 +123,16 @@ ghcPrimExports :: [IfaceExport]
ghcPrimExports
= map (Avail . idName) ghcPrimIds ++
map (Avail . idName . primOpId) allThePrimOps ++
- [ AvailTC n [n]
+ [ AvailTC n [n]
| tc <- funTyCon : primTyCons, let n = tyConName tc ]
\end{code}
%************************************************************************
-%* *
+%* *
\subsection{Built-in keys}
-%* *
+%* *
%************************************************************************
ToDo: make it do the ``like'' part properly (as in 0.26 and before).
@@ -151,9 +145,9 @@ maybeIntLikeCon con = con `hasKey` intDataConKey
%************************************************************************
-%* *
+%* *
\subsection{Class predicates}
-%* *
+%* *
%************************************************************************
\begin{code}