-
Notifications
You must be signed in to change notification settings - Fork 251
Add instances of IsString (List Char)
#2756
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
Conversation
Additionally, the |
I would think those would be worth a parallel PR. And it might not be bad to wait a day, so see what comments come in on this one. |
src/Data/List/Literals.agda
Outdated
{ Constraint = λ _ → ⊤ | ||
; fromString = λ s → toList s | ||
} | ||
instance |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So I think this is backwards (unfortunately). We want instances declared in Data.List.Instances
so that people who don't want them can avoid them entirely.
We do want isString
defined here - just not as an instance.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry - I misinterpreted the response to the issue. I've removed the instance declaration from that module.
You'll also need |
Thanks for catching this. I've added the change under "Minor Improvements". |
Actually: you need to do this under |
962b5a4
to
80a9979
Compare
No worries; I just amended the commit. |
There's a whitespace problem that will need fixed. |
Sorry, didn't see that! It should be fixed now (or, at least, the tool gives no complaints) |
For some reason, your example at the top of not having I was curious to look at it, not least because my (probably faulty!) impression is that no explicit use of |
I'm happy to take this off the docket and merge it now for v2.3,unless there are violent objections!? |
As discussed in #2745, adds instances of
IsString (List Char)
toData.List.Instances
andData.List.Literals
. If these changes need tests I can add some.There's a small potential for confusion in the current configuration, however. The
Constraint
field ofList Char
'sisString
is the constant functionλ _ → ⊤
, so an instance of⊤
must be in scope. This means that a user which includesData.List.Instances
but does not havett
defined will get an error.For example,