-@derivableClassKeys@ is also used in checking \tr{deriving} constructs
-(@TcDeriv@).
-
-@derivingOccurrences@ maps a class name to a list of the (qualified)
-occurrences that will be mentioned by the derived code for the class
-when it is later generated. We don't need to put in things that are
-WiredIn (because they are already mapped to their correct name by the
-@NameSupply@. The class itself, and all its class ops, is already
-flagged as an occurrence so we don't need to mention that either.
-
-@derivingOccurrences@ has an item for every derivable class, even if
-that item is empty, because we treat lookup failure as indicating that
-the class is illegal in a deriving clause.
-
-\begin{code}
-derivingOccurrences :: UniqFM [RdrName]
-derivingOccurrences = listToUFM deriving_occ_info
-
-derivableClassKeys = map fst deriving_occ_info
-
-deriving_occ_info
- = [ (eqClassKey, [intTyCon_RDR, and_RDR, not_RDR])
- , (ordClassKey, [intTyCon_RDR, compose_RDR, eqTag_RDR])
- -- EQ (from Ordering) is needed to force in the constructors
- -- as well as the type constructor.
- , (enumClassKey, [intTyCon_RDR, eq_RDR, ge_RDR, and_RDR, map_RDR, plus_RDR, showsPrec_RDR, append_RDR])
- -- The last two Enum deps are only used to produce better
- -- error msgs for derived toEnum methods.
- , (boundedClassKey, [intTyCon_RDR])
- , (showClassKey, [intTyCon_RDR, numClass_RDR, ordClass_RDR, compose_RDR, showString_RDR,
- showParen_RDR, showSpace_RDR, showList___RDR])
- , (readClassKey, [intTyCon_RDR, numClass_RDR, ordClass_RDR, append_RDR,
- foldr_RDR, build_RDR,
- -- foldr and build required for list comprehension
- -- KSW 2000-06
- lex_RDR, readParen_RDR, readList___RDR, thenM_RDR])
- -- returnM (and the rest of the Monad class decl)
- -- will be forced in as result of depending
- -- on thenM. -- SOF 1/99
- , (ixClassKey, [intTyCon_RDR, numClass_RDR, and_RDR, map_RDR, enumFromTo_RDR,
- foldr_RDR, build_RDR,
- -- foldr and build required for list comprehension used
- -- with single constructor types -- KSW 2000-06
- returnM_RDR, failM_RDR])
- -- the last two are needed to force returnM, thenM and failM
- -- in before typechecking the list(monad) comprehension
- -- generated for derived Ix instances (range method)
- -- of single constructor types. -- SOF 8/97
- ]
- -- intTyCon: Practically any deriving needs Int, either for index calculations,
- -- or for taggery.
- -- ordClass: really it's the methods that are actually used.
- -- numClass: for Int literals
-\end{code}
-
-