lamdu / hypertypes

Hypertypes - generic programming for heterogeneous recursive types
Other
112 stars 9 forks source link

Make use of GADTs rather than TypeFamilies for nicer inference and type errors #1

Open yairchu opened 5 years ago

yairchu commented 5 years ago

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:

expipiplus1 commented 1 year ago

FWIW kind-generics supports deriving a Generic-like interface for GADT's