Split the Id related functions out from Var into Id, document Var and some of Id
[ghc-hetmet.git] / compiler / basicTypes / MkId.lhs
index 637d4c5..eb85111 100644 (file)
@@ -1,4 +1,4 @@
-\%
+%
 % (c) The University of Glasgow 2006
 % (c) The AQUA Project, Glasgow University, 1998
 %
@@ -6,17 +6,17 @@
 This module contains definitions for the IdInfo for things that
 have a standard form, namely:
 
-* data constructors
-* record selectors
-* method and superclass selectors
-* primitive operations
+- data constructors
+- record selectors
+- method and superclass selectors
+- primitive operations
 
 \begin{code}
 {-# OPTIONS -fno-warn-missing-signatures #-}
 -- The above warning supression flag is a temporary kludge.
 -- While working on this module you are encouraged to remove it and fix
 -- any warnings in the module. See
---     http://hackage.haskell.org/trac/ghc/wiki/Commentary/CodingStyle#Warnings
+--  <http://hackage.haskell.org/trac/ghc/wiki/Commentary/CodingStyle#Warnings>
 -- for details
 
 module MkId (
@@ -544,7 +544,7 @@ mkRecordSelId tycon field_label
     data_tv_set = tyVarsOfType data_ty
     data_tvs    = varSetElems data_tv_set
     
-        -- *Very* tiresomely, the selectors are (unnecessarily!) overloaded over
+        -- _Very_ tiresomely, the selectors are (unnecessarily!) overloaded over
         -- just the dictionaries in the types of the constructors that contain
         -- the relevant field.  [The Report says that pattern matching on a
         -- constructor gives the same constraints as applying it.]  Urgh.  
@@ -1141,12 +1141,12 @@ realWorldName    = mkWiredInIdName gHC_PRIM (fsLit "realWorld#")    realWorldPri
 lazyIdName       = mkWiredInIdName gHC_BASE (fsLit "lazy")         lazyIdKey           lazyId
 
 errorName                = mkWiredInIdName gHC_ERR (fsLit "error")            errorIdKey eRROR_ID
-recSelErrorName          = mkWiredInIdName gHC_ERR (fsLit "recSelError")     recSelErrorIdKey rEC_SEL_ERROR_ID
-runtimeErrorName         = mkWiredInIdName gHC_ERR (fsLit "runtimeError")    runtimeErrorIdKey rUNTIME_ERROR_ID
-irrefutPatErrorName      = mkWiredInIdName gHC_ERR (fsLit "irrefutPatError") irrefutPatErrorIdKey iRREFUT_PAT_ERROR_ID
-recConErrorName          = mkWiredInIdName gHC_ERR (fsLit "recConError")     recConErrorIdKey rEC_CON_ERROR_ID
-patErrorName             = mkWiredInIdName gHC_ERR (fsLit "patError")         patErrorIdKey pAT_ERROR_ID
-noMethodBindingErrorName = mkWiredInIdName gHC_ERR (fsLit "noMethodBindingError")
+recSelErrorName          = mkWiredInIdName cONTROL_EXCEPTION (fsLit "recSelError")     recSelErrorIdKey rEC_SEL_ERROR_ID
+runtimeErrorName         = mkWiredInIdName cONTROL_EXCEPTION (fsLit "runtimeError")    runtimeErrorIdKey rUNTIME_ERROR_ID
+irrefutPatErrorName      = mkWiredInIdName cONTROL_EXCEPTION (fsLit "irrefutPatError") irrefutPatErrorIdKey iRREFUT_PAT_ERROR_ID
+recConErrorName          = mkWiredInIdName cONTROL_EXCEPTION (fsLit "recConError")     recConErrorIdKey rEC_CON_ERROR_ID
+patErrorName             = mkWiredInIdName cONTROL_EXCEPTION (fsLit "patError")         patErrorIdKey pAT_ERROR_ID
+noMethodBindingErrorName = mkWiredInIdName cONTROL_EXCEPTION (fsLit "noMethodBindingError")
                                            noMethodBindingErrorIdKey nO_METHOD_BINDING_ERROR_ID
 nonExhaustiveGuardsErrorName 
   = mkWiredInIdName gHC_ERR (fsLit "nonExhaustiveGuardsError") 
@@ -1314,7 +1314,7 @@ errorTy  = mkSigmaTy [openAlphaTyVar] [] (mkFunTys [mkListTy charTy] openAlphaTy
 \begin{code}
 pcMiscPrelId :: Name -> Type -> IdInfo -> Id
 pcMiscPrelId name ty info
-  = mkVanillaGlobal name ty info
+  = mkVanillaGlobalWithInfo name ty info
     -- We lie and say the thing is imported; otherwise, we get into
     -- a mess with dependency analysis; e.g., core2stg may heave in
     -- random calls to GHCbase.unpackPS__.  If GHCbase is the module