Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
yairchu opened this issue Jun 17, 2019 · 1 comment

Comments

@yairchu
Copy link
Member

yairchu commented Jun 17, 2019

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
@expipiplus1
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants