AlgTyConFlavour(..),
DataConDetails(..), visibleDataCons,
- isFunTyCon, isUnLiftedTyCon, isBoxedTyCon, isProductTyCon,
+ isFunTyCon, isUnLiftedTyCon, isProductTyCon,
isAlgTyCon, isDataTyCon, isSynTyCon, isNewTyCon, isPrimTyCon,
isEnumerationTyCon,
isTupleTyCon, isUnboxedTupleTyCon, isBoxedTupleTyCon, tupleTyConBoxity,
mkKindCon,
mkSuperKindCon,
- setTyConName,
-
tyConName,
tyConKind,
tyConUnique,
maybeTyConSingleCon,
- matchesTyCon,
-
-- Generics
tyConHasGenerics
) where
synTyConDefn = rhs,
argVrcs = argvrcs
}
-
-setTyConName tc name = tc {tyConName = name, tyConUnique = nameUnique name}
-
\end{code}
\begin{code}
isUnLiftedTyCon (TupleTyCon {tyConBoxed = boxity}) = not (isBoxed boxity)
isUnLiftedTyCon _ = False
+#ifdef UNUSED
-- isBoxedTyCon should not be applied to SynTyCon, nor KindCon
isBoxedTyCon :: TyCon -> Bool
isBoxedTyCon (AlgTyCon {}) = True
isBoxedTyCon (FunTyCon {}) = True
isBoxedTyCon (TupleTyCon {tyConBoxed = boxity}) = isBoxed boxity
isBoxedTyCon (PrimTyCon {primTyConRep = rep}) = isFollowableRep rep
+#endif
-- isAlgTyCon returns True for both @data@ and @newtype@
isAlgTyCon :: TyCon -> Bool
instance NamedThing TyCon where
getName = tyConName
\end{code}
-
-
-%************************************************************************
-%* *
-\subsection{Kind constructors}
-%* *
-%************************************************************************
-
-@matchesTyCon tc1 tc2@ checks whether an appliation
-(tc1 t1..tn) matches (tc2 t1..tn). By "matches" we basically mean "equals",
-except that at the kind level tc2 might have more boxity info than tc1.
-
-\begin{code}
-matchesTyCon :: TyCon -- Expected (e.g. arg type of function)
- -> TyCon -- Inferred (e.g. type of actual arg to function)
- -> Bool
-
-matchesTyCon tc1 tc2 = uniq1 == uniq2 || uniq1 == anyBoxConKey
- where
- uniq1 = tyConUnique tc1
- uniq2 = tyConUnique tc2
-\end{code}
-
-
-