-
-data AlgTyConFlavour
- = DataTyCon -- Data type
-
- | EnumTyCon -- Special sort of enumeration type
-
- | NewTyCon Type -- Newtype, with its *ultimate* representation type
+ -- [] means "no information, assume the worst"
+
+data AlgTyConRhs
+ = AbstractTyCon -- We know nothing about this data type, except
+ -- that it's represented by a pointer
+ -- Used when we export a data type abstractly into
+ -- an hi file
+
+ | DataTyCon
+ (Maybe [PredType]) -- Just theta => this tycon was declared in H98 syntax
+ -- with the specified "stupid theta"
+ -- e.g. data Ord a => T a = ...
+ -- Nothing => this tycon was declared by giving the
+ -- type signatures for each constructor
+ -- (new GADT stuff)
+ -- e.g. data T a where { ... }
+ [DataCon] -- The constructors; can be empty if the user declares
+ -- the type to have no constructors
+ Bool -- Cached: True <=> an enumeration type
+
+ | NewTyCon -- Newtypes always have exactly one constructor
+ DataCon -- The unique constructor; it has no existentials
+ Type -- Cached: the argument type of the constructor
+ -- = the representation type of the tycon
+
+ Type -- Cached: the *ultimate* representation type