Stock deriving improvements
Motivation
Trying to use GHC-derived code in performance-sensitive applications leads to several problems:
- SPECIALISE pragmas have nothing to inline if the relevant types with GHC-derived instances are defined in another file
- No class law RULES seem to be generated, either. This is particularly troublesome with DeriveFunctor/DeriveFoldable/DeriveTraversable.
Proposal
- GHC-derived instances should have INLINABLE pragmas.
- I'm pretty certain that GHC generates law-abiding instances for Functor/Foldable/Traversable, so the relevant laws should be generated as RULES specific for the types its generating instances for.