+%************************************************************************
+%* *
+\subsection{Basic Id manipulation}
+%* *
+%************************************************************************
+
+\begin{code}
+idName :: Id -> Name
+idName = Var.varName
+
+idUnique :: Id -> Unique
+idUnique = varUnique
+
+idType :: Id -> Kind
+idType = varType
+
+idInfo :: Id -> IdInfo
+idInfo = varIdInfo
+
+idPrimRep :: Id -> PrimRep
+idPrimRep id = typePrimRep (idType id)
+
+globalIdDetails :: Id -> GlobalIdDetails
+globalIdDetails = globalIdVarDetails
+
+
+setIdName :: Id -> Name -> Id
+setIdName = setVarName
+
+setIdUnique :: Id -> Unique -> Id
+setIdUnique = setVarUnique
+
+-- | Not only does this set the 'Id' 'Type', it also evaluates the type to try and
+-- reduce space usage
+setIdType :: Id -> Type -> Id
+setIdType id ty = seqType ty `seq` Var.setVarType id ty
+
+setIdExported :: Id -> Id
+setIdExported = setIdVarExported
+
+setIdNotExported :: Id -> Id
+setIdNotExported = setIdVarNotExported
+
+localiseId :: Id -> Id
+-- Make an with the same unique and type as the
+-- incoming Id, but with an *Internal* Name and *LocalId* flavour
+localiseId id
+ | isLocalId id && isInternalName name
+ = id
+ | otherwise
+ = mkLocalIdWithInfo (localiseName name) (idType id) (idInfo id)
+ where
+ name = idName id
+
+globaliseId :: GlobalIdDetails -> Id -> Id
+globaliseId = globaliseIdVar
+
+lazySetIdInfo :: Id -> IdInfo -> Id
+lazySetIdInfo = lazySetVarIdInfo