Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Give Compose's instances explicit kind signatures
Previously, the promoted versions of certain `Compose` instances (`Functor`, `Foldable`, etc.) would be overly general due to the fact that `singletons-th` omits instance contexts during promotion. For example, the promoted `Functor` instance for `Compose` was: ```hs instance PFunctor (Compose (f :: k -> Type) (g :: Type -> k)) where ... ``` But this was too general, as `f` and `g` should both be of kind `Type -> Type` instead. The defunctionalization symbols associated with the instances also had a similar problem. This patch annotates each instance with an explicit kind (e.g., `Functor (Compose (f :: Type -> Type) g)` to ensure that the promoted instances also have the intended kind. This is very much in the same spirit as the situation described in `Note [Using standalone kind signatures not present in the base library]` in `Control.Monad.Singletons.Internal`, but for instance declarations instead of class declarations. Resolves the "Overly polymorphic instance methods" section of #601.
- Loading branch information