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

IsString should not be implemented #124

Open
zenzike opened this issue Aug 8, 2016 · 1 comment
Open

IsString should not be implemented #124

zenzike opened this issue Aug 8, 2016 · 1 comment

Comments

@zenzike
Copy link

zenzike commented Aug 8, 2016

I am a bit torn by the IsString instance. On the one hand, it makes it easy to parse literal text. On the other hand, in parsers I often don't really want to be parsing just text when I put things in quotes in BNF. Usually something like "foo" really means parse the token "foo", and also deal with trailing whitespace. I want to make this magic happen by providing my own version of IsString, but since attoparsec has it's own, I'm stuck. I suggest the library does not provide this instance or that this is made overlappable, since Haskell gives me no mechanism for hiding it or selecting my own. Currently I'm dealing with a duplicate instance declaration rather than an overlap, and I can't force the compiler to select my version.

@bgamari
Copy link
Collaborator

bgamari commented Sep 15, 2016

I also am rather torn on this. However, I'm not really sure we can easily do much about this given that this instance has been in the wild for quite some time now. I have no idea how much code would break if we removed it.

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