diff options
author | Austin Seipp <austin@well-typed.com> | 2014-07-18 22:21:28 -0500 |
---|---|---|
committer | Austin Seipp <austin@well-typed.com> | 2014-07-20 16:55:48 -0500 |
commit | b5b1a2dbd9f6f8057317ba36a65416a6d3daf475 (patch) | |
tree | 216294edcdb86915a1b04088f7aef0ce9482adad | |
parent | 3ccc80cb2ed2c79243dbc9a1f981aac87163d060 (diff) | |
download | haskell-b5b1a2dbd9f6f8057317ba36a65416a6d3daf475.tar.gz |
prelude: detabify/unwhitespace PrelInfo
Signed-off-by: Austin Seipp <austin@well-typed.com>
-rw-r--r-- | compiler/prelude/PrelInfo.lhs | 63 |
1 files changed, 28 insertions, 35 deletions
diff --git a/compiler/prelude/PrelInfo.lhs b/compiler/prelude/PrelInfo.lhs index 829b5e3bf9..eaefff2364 100644 --- a/compiler/prelude/PrelInfo.lhs +++ b/compiler/prelude/PrelInfo.lhs @@ -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} |