getTyVar_maybe, splitSigmaTy, unUsgTy, boxedTypeKind
)
import TypeRep ( Type(..), TyNote(..) ) -- toHsType sees the representation
-import TyCon ( isTupleTyCon, tupleTyConBoxity, tyConArity, tyConClass_maybe )
+import TyCon ( isTupleTyCon, tupleTyConBoxity, tyConArity )
import RdrName ( RdrName )
import Name ( toRdrName )
import OccName ( NameSpace )
ExplicitList es -> mapP (\e -> checkPat e []) es `thenP` \ps ->
returnP (ListPatIn ps)
- ExplicitTuple es Boxed -> mapP (\e -> checkPat e []) es `thenP` \ps ->
- returnP (TuplePatIn ps Boxed)
- -- Unboxed tuples are illegal in patterns
+ ExplicitTuple es b -> mapP (\e -> checkPat e []) es `thenP` \ps ->
+ returnP (TuplePatIn ps b)
RecordCon c fs -> mapP checkPatField fs `thenP` \fs ->
returnP (RecPatIn c fs)
toRdrName, nameEnvElts,
)
import OccName ( isSysOcc )
-import TyCon ( TyCon, tyConClass_maybe )
+import TyCon ( TyCon, isClassTyCon )
import Class ( Class )
import PrelNames ( mAIN_Name, mainKey )
import UniqSupply ( UniqSupply )
local_classes = filter isLocallyDefined classes
local_tycons = [ tc | tc <- tycons,
isLocallyDefined tc,
- Nothing <- [tyConClass_maybe tc]
+ not (isClassTyCon tc)
]
-- For local_tycons, filter out the ones derived from classes
-- Otherwise the latter show up in interface files
tyConTheta,
tyConPrimRep,
tyConArity,
- tyConClass_maybe,
+ isClassTyCon,
getSynTyConDefn,
maybeTyConSingleCon,
algTyConRec :: RecFlag, -- Tells whether the data type is part of
-- a mutually-recursive group or not
- algTyConClass_maybe :: Maybe Class -- Nothing for ordinary types;
- -- Just c for the type constructor
- -- for dictionaries of class c.
-
+ algTyConClass :: Bool -- True if this tycon comes from a class declaration
}
| PrimTyCon { -- Primitive types; cannot be defined in Haskell
dataCons = cons,
noOfDataCons = ncons,
algTyConDerivings = derivs,
- algTyConClass_maybe = Nothing,
+ algTyConClass = False,
algTyConFlavour = flavour,
algTyConRec = rec
}
dataCons = [con],
noOfDataCons = 1,
algTyConDerivings = [],
- algTyConClass_maybe = Just clas,
+ algTyConClass = True,
algTyConFlavour = flavour,
algTyConRec = NonRecursive
}
\end{code}
\begin{code}
-tyConClass_maybe :: TyCon -> Maybe Class
-tyConClass_maybe (AlgTyCon {algTyConClass_maybe = maybe_cls}) = maybe_cls
-tyConClass_maybe other_tycon = Nothing
+isClassTyCon :: TyCon -> Bool
+isClassTyCon (AlgTyCon {algTyConClass = is_class_tycon}) = is_class_tycon
+isClassTyCon other_tycon = False
\end{code}
isFunTyCon, isDataTyCon, isNewTyCon, newTyConRep,
isAlgTyCon, isSynTyCon, tyConArity,
tyConKind, tyConDataCons, getSynTyConDefn,
- tyConPrimRep, tyConClass_maybe
+ tyConPrimRep
)
-- others