Commit b5b1a2db authored by Austin Seipp's avatar Austin Seipp
Browse files

prelude: detabify/unwhitespace PrelInfo


Signed-off-by: default avatarAustin Seipp <austin@well-typed.com>
parent 3ccc80cb
......@@ -5,13 +5,6 @@
\begin{code}
{-# LANGUAGE CPP #-}
{-# OPTIONS_GHC -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
module PrelInfo (
wiredInIds, ghcPrimIds,
primOpRules, builtinRules,
......@@ -19,7 +12,7 @@ module PrelInfo (
ghcPrimExports,
wiredInThings, basicKnownKeyNames,
primOpId,
-- Random other things
maybeCharLikeCon, maybeIntLikeCon,
......@@ -49,9 +42,9 @@ import Data.Array
\end{code}
%************************************************************************
%* *
%* *
\subsection[builtinNameInfo]{Lookup built-in names}
%* *
%* *
%************************************************************************
Notes about wired in things
......@@ -59,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.
......@@ -78,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
......@@ -100,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
......@@ -117,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
......@@ -130,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).
......@@ -152,9 +145,9 @@ maybeIntLikeCon con = con `hasKey` intDataConKey
%************************************************************************
%* *
%* *
\subsection{Class predicates}
%* *
%* *
%************************************************************************
\begin{code}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment