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

Add Read instances for names and binder or how to derive it #38

Open
ksenia-portu opened this issue Jul 5, 2019 · 1 comment
Open

Comments

@ksenia-portu
Copy link

ksenia-portu commented Jul 5, 2019

Do Read instances don't exist by design choice or it can be somehow derived? Instances for Name a from http://hackage.haskell.org/package/unbound-generics-0.4.0/docs/src/Unbound.Generics.LocallyNameless.Name.html#line-84
and Bind p t from http://hackage.haskell.org/package/unbound-generics-0.4.0/docs/src/Unbound.Generics.LocallyNameless.Bind.html#Bind

@lambdageek
Copy link
Owner

It's not by design, rather:

  • Read instances weren't in Unbound so I didn't add them to unbound-generics
  • For most of my own projects using unbound-generics I was not using it for the surface syntax of a language - only for an internal IR. So the Show instances were only for debugging, not for anything user-visible. Consequently I never had a use for Read - the surface languages always used normal parsers (either using happy or using parsec).

I'd accept a PR implementing Read instances, but they would need to be perfect inverses of Show - which I'm not sure is possible because the Show instances omit some information.

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

No branches or pull requests

2 participants