This repository was archived by the owner on Aug 3, 2024. It is now read-only.
This repository was archived by the owner on Aug 3, 2024. It is now read-only.
Feature request: try to normalize type instance declarations #1290
Open
Description
Motivation:
We sometimes care about what a type synonym instance declaration normalizes to, instead of its exact definition, this is especially true for associated type synonym instances of derived typeclass instances.
Some thoughts on how to implement it:
The GHC API exposes a function called typeKind
that can normalize types (this is the function used by GHCi's !kind
command), but it does not allow free variables. Suppose the type family takes type variable v_1 .. v_n with kind k_1 .. k_n, we could define empty data d_1 .. d_n with kind k_1 .. k_n each, then we are able to normalize the type after feeding these empty data type into the type family.