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

Data, Typeable, Generic instances for InternedText? #10

Open
spinda opened this issue Dec 18, 2015 · 1 comment
Open

Data, Typeable, Generic instances for InternedText? #10

spinda opened this issue Dec 18, 2015 · 1 comment

Comments

@spinda
Copy link

spinda commented Dec 18, 2015

Would it be possible to add (derive) Data, Typeable, and Generic instances for InternedText? That way structures which use them can themselves have derived Data / Generic instances.

@layus
Copy link

layus commented Jan 9, 2021

These would be really helpful, but a bit tricky. See https://github.com/haskell-nix/hnix/pull/811/files#diff-3d76949b3ec463adc3cb7c86318020458995f4f80602365dc8e413c34f278caeR192-R216

  • Data instance can use the same hack as Text, which has severe limitations inside template haskell.
  • Typeable instance is not more needed in recent GHC
  • No idea about generic.

Would also be nice to provide Show, Read, Binary and anything that makes it a better drop-in replacement for text.

The limit being that we do not want a monoid instance. That would unintern and re-intern strings implicitly. Not a good idea IMHO.

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