-#include "HsVersions.h"
-
-import {-# SOURCE #-} CoreUnfold ( Unfolding )
-
-import CmdLineOpts ( opt_PprStyle_All )
-import Bag
-import IdInfo
-import Name ( nameUnique, isLocalName, mkSysLocalName,
- isWiredInName, setNameVisibility, mkNameVisible,
- changeUnique,
- ExportFlag(..), Provenance,
- OccName(..), Name, Module,
- NamedThing(..)
- )
-import PrimOp ( PrimOp )
-import PrelMods ( pREL_TUP, pREL_BASE )
-import FieldLabel ( fieldLabelName, FieldLabel(..) )
-import SrcLoc ( mkBuiltinSrcLoc )
-import TysWiredIn ( tupleTyCon )
-import TyCon ( TyCon, isDataTyCon, isNewTyCon )
-import Type ( mkSigmaTy, mkTyVarTys, mkFunTys,
- mkTyConApp, instantiateTy, mkForAllTys,
- tyVarsOfType, instantiateTy, typePrimRep,
- instantiateTauTy,
- ThetaType, TauType, Type, GenType
- )
-import TyVar ( TyVar, alphaTyVars, isEmptyTyVarSet,
- TyVarEnv, zipTyVarEnv, mkTyVarEnv
- )
-import UniqFM
-import UniqSet -- practically all of it
-import Unique ( Unique, Uniquable(..), getBuiltinUniques )
-import Outputable
-import SrcLoc ( SrcLoc )
-import Util ( nOfThem, assoc )
-import GlaExts ( Int# )
-\end{code}
-
-Here are the @Id@ and @IdDetails@ datatypes; also see the notes that
-follow.
-
-Every @Id@ has a @Unique@, to uniquify it and for fast comparison, a
-@Type@, and an @IdInfo@ (non-essential info about it, e.g.,
-strictness). The essential info about different kinds of @Ids@ is
-in its @IdDetails@.
-
-ToDo: possibly cache other stuff in the single-constructor @Id@ type.
-
-\begin{code}
-data GenId ty = Id {
- idUnique :: Unique, -- Key for fast comparison
- idName :: Name,
- idType :: ty, -- Id's type; used all the time;
- idDetails :: IdDetails, -- Stuff about individual kinds of Ids.
- idInfo :: IdInfo -- Properties of this Id deduced by compiler
- }
-
-type Id = GenId Type
-
-data StrictnessMark = MarkedStrict | NotMarkedStrict
-
-data IdDetails
-
- ---------------- Local values
-
- = VanillaId Bool -- Ordinary Id
- -- True <=> no free type vars
-
- | PrimitiveId PrimOp -- The Id for a primitive operation
-
-
- ---------------- Data constructors
-
- | AlgConId -- Used for both data and newtype constructors.
- -- You can tell the difference by looking at the TyCon
- ConTag
- [StrictnessMark] -- Strict args; length = arity
- [FieldLabel] -- Field labels for this constructor;
- --length = 0 (not a record) or arity
-
- [TyVar] ThetaType -- Type vars and context for the data type decl
- [TyVar] ThetaType -- Ditto for the context of the constructor,
- -- the existentially quantified stuff
- [Type] TyCon -- Args and result tycon
- -- the type is:
- -- forall tyvars1 ++ tyvars2. theta1 ++ theta2 =>
- -- unitype_1 -> ... -> unitype_n -> tycon tyvars
-
- | TupleConId Int -- Its arity
-
- | RecordSelId FieldLabel
-
- | SpecPragmaId -- This guy exists only to make Ids that are
- -- on the *LHS* of bindings created by SPECIALISE
- -- pragmas; eg: s = f Int d
- -- The SpecPragmaId is never itself mentioned; it
- -- exists solely so that the specialiser will find
- -- the call to f, and make specialised version of it.
- -- The SpecPragmaId binding is discarded by the specialiser
- -- when it gathers up overloaded calls.
- -- Meanwhile, it is not discarded as dead code.