module PrelNames,
module MkId,
- wiredInNames, -- Names of wired in things
-
+ wiredInThings, -- Names of wired in things
+ wiredInThingEnv,
-- Primop RdrNames
eqH_Char_RDR, ltH_Char_RDR, eqH_Word_RDR, ltH_Word_RDR,
import PrelNames -- Prelude module names
import PrimOp ( PrimOp(..), allThePrimOps, primOpRdrName )
-import DataCon ( DataCon, dataConId, dataConWrapId )
+import DataCon ( DataCon )
import MkId ( mkPrimOpId, wiredInIds )
import MkId -- All of it, for re-export
import TysPrim ( primTyCons )
import TysWiredIn ( wiredInTyCons )
+import HscTypes ( TyThing(..), implicitTyThingIds, TypeEnv, mkTypeEnv )
-- others:
-import RdrName ( RdrName )
-import Name ( Name, getName )
-import TyCon ( tyConDataConsIfAvailable, TyCon )
import Class ( Class, classKey )
import Type ( funTyCon )
-import Bag
-import BasicTypes ( Boxity(..) )
import Util ( isIn )
\end{code}
@Classes@, the other to look up values.
\begin{code}
-wiredInNames :: [Name]
-wiredInNames
- = bagToList $ unionManyBags
- [ -- Wired in TyCons
- unionManyBags (map getTyConNames ([funTyCon] ++ primTyCons ++ wiredInTyCons))
+wiredInThings :: [TyThing]
+wiredInThings
+ = concat
+ [ -- Wired in TyCons and their implicit Ids
+ tycon_things
+ , map AnId (implicitTyThingIds tycon_things)
-- Wired in Ids
- , listToBag (map getName wiredInIds)
+ , map AnId wiredInIds
-- PrimOps
- , listToBag (map (getName . mkPrimOpId) allThePrimOps)
+ , map (AnId . mkPrimOpId) allThePrimOps
]
-\end{code}
+ where
+ tycon_things = map ATyCon ([funTyCon] ++ primTyCons ++ wiredInTyCons)
-
-\begin{code}
-getTyConNames :: TyCon -> Bag Name
-getTyConNames tycon
- = getName tycon `consBag`
- unionManyBags (map get_data_con_names (tyConDataConsIfAvailable tycon))
- -- Synonyms return empty list of constructors
- where
- get_data_con_names dc = listToBag [getName (dataConId dc), -- Worker
- getName (dataConWrapId dc)] -- Wrapper
+wiredInThingEnv :: TypeEnv
+wiredInThingEnv = mkTypeEnv wiredInThings
\end{code}
We let a lot of "non-standard" values be visible, so that we can make