We currently use the GetHyperType type family to unwrap 'AHyperTypes, but Haskell doesn't currently understand that it's a bijective type family so it doesn't infer that trees are always of shape k0 (`HyperType k1) and this leads to less helpful type errors and sometimes requires extra type signatures or usage of the asHyper inference-assisting identity function.
Using GADTs instead of TypeFamilies would provide better error messages. But transitioning to them is problematic because:
Generic derivation for GADTs doesn't work
lens TH code doesn't always work for GADTs
Our own TH derivations need to be augmented to support GADTs
We currently use the
GetHyperType
type family to unwrap'AHyperType
s, but Haskell doesn't currently understand that it's a bijective type family so it doesn't infer that trees are always of shapek0 (`HyperType k1)
and this leads to less helpful type errors and sometimes requires extra type signatures or usage of theasHyper
inference-assisting identity function.Using
GADTs
instead ofTypeFamilies
would provide better error messages. But transitioning to them is problematic because:Generic
derivation for GADTs doesn't worklens
TH code doesn't always work for GADTs