mkDictFunId,
mkIdWithNewUniq, mkIdWithNewName, mkIdWithNewType,
mkImported,
- mkInstId,
mkMethodSelId,
mkRecordSelId,
mkSameSpecCon,
-- PRINTING and RENUMBERING
pprId,
+-- pprIdInUnfolding,
showId,
-- Specialialisation
addIdDemandInfo,
addIdStrictness,
addIdUpdateInfo,
- addIdDeforestInfo,
getIdArity,
getIdDemandInfo,
getIdInfo,
-- actually do comparisons that way, we kindly supply
-- a Unique for that purpose.
- | InstId -- An instance of a dictionary, class operation,
- -- or overloaded value (Local name)
- Bool -- as for LocalId
-
| SpecId -- A specialisation of another Id
Id -- Id of which this is a specialisation
[Maybe Type] -- Types at which it is specialised;
(T a b ..).
%----------------------------------------------------------------------
-\item[@InstId@:]
-
-%----------------------------------------------------------------------
\item[@SpecId@:]
%----------------------------------------------------------------------
machine makes a closure, it puts all the free variables in the
closure; the above are not required.)
\end{itemize}
-Note that @InstIds@, @Locals@ and @SysLocals@ {\em may} have the above
+Note that @Locals@ and @SysLocals@ {\em may} have the above
properties, but they may not.
\end{enumerate}
chk (DictFunId _ _) = True
chk (SpecId unspec _ _) = toplevelishId unspec
-- depends what the unspecialised thing is
- chk (InstId _) = False -- these are local
chk (LocalId _) = False
chk (SysLocalId _) = False
chk (SpecPragmaId _ _) = False
chk (DefaultMethodId _) = True
chk (DictFunId _ _) = True
chk (SpecId _ _ no_free_tvs) = no_free_tvs
- chk (InstId no_free_tvs) = no_free_tvs
chk (LocalId no_free_tvs) = no_free_tvs
chk (SysLocalId no_free_tvs) = no_free_tvs
chk (SpecPragmaId _ no_free_tvs) = no_free_tvs
new_maybes = map apply_to_maybe ty_maybes
in
SpecId new_unspec new_maybes (no_free_tvs ty)
- -- ToDo: gratuitous recalc no_ftvs???? (also InstId)
+ -- ToDo: gratuitous recalc no_ftvs????
where
apply_to_maybe Nothing = Nothing
apply_to_maybe (Just ty) = Just (ty_fn ty)
details = LocalId (no_free_tvs ty)
name = mkCompoundName name_fn u (getName unwrkr)
name_fn wkr_str = SLIT("$w") _APPEND_ wkr_str
-
-mkInstId u ty name
- = Id u name ty (InstId (no_free_tvs ty)) NoPragmaInfo noIdInfo
\end{code}
%************************************************************************
%************************************************************************
%* *
-\subsection[Id-arities]{Deforestation related functions}
-%* *
-%************************************************************************
-
-\begin{code}
-addIdDeforestInfo :: Id -> DeforestInfo -> Id
-addIdDeforestInfo (Id u n ty details pinfo info) def_info
- = Id u n ty details pinfo (info `addDeforestInfo` def_info)
-\end{code}
-
-%************************************************************************
-%* *
\subsection[constructor-funs]{@DataCon@-related functions (incl.~tuples)}
%* *
%************************************************************************
dataConFieldLabels :: DataCon -> [FieldLabel]
dataConFieldLabels (Id _ _ _ (AlgConId _ _ fields _ _ _ _ _ _) _ _) = fields
dataConFieldLabels (Id _ _ _ (TupleConId _) _ _) = []
+#ifdef DEBUG
+dataConFieldLabels x@(Id _ _ _ idt _ _) =
+ panic ("dataConFieldLabel: " ++
+ (case idt of
+ LocalId _ -> "l"
+ SysLocalId _ -> "sl"
+ PrimitiveId _ -> "p"
+ SpecPragmaId _ _ -> "sp"
+ ImportedId -> "i"
+ RecordSelId _ -> "r"
+ SuperDictSelId _ _ -> "sc"
+ MethodSelId _ -> "m"
+ DefaultMethodId _ -> "d"
+ DictFunId _ _ -> "di"
+ SpecId _ _ _ -> "spec"))
+#endif
dataConStrictMarks :: DataCon -> [StrictnessMark]
dataConStrictMarks (Id _ _ _ (AlgConId _ stricts _ _ _ _ _ _ _) _ _) = stricts