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

Use case-insensitive ByteString in EmailAddress #36

Open
creichert opened this issue May 30, 2018 · 2 comments
Open

Use case-insensitive ByteString in EmailAddress #36

creichert opened this issue May 30, 2018 · 2 comments
Milestone

Comments

@creichert
Copy link

I think it would be appropriate to use the case-insensitive package to represent the internal ByteStrings domain in EmailAddress. This would also seem to "fix" the Eq instance.

Has this been considered before? I've generally implemented the entire email address in a web app as newtype Email = Email CaseInsensitive.ByteString but after a little research, it appears the part before the @ can technically be interpreted as case-sensitive.

@Porges
Copy link
Owner

Porges commented Jun 3, 2018

Yes, at the moment there's no normalization performed except for stripping non-significant whitespace and comments. Really the domain part should be handled by a package specifically for handling domains, we could also argue that punycode/Unicode encodings of the same name should be equivalent and that an IPv4-in-IPv6 address should be considered the same as the equivalent address in IPv4. I've started handling the domains more correctly in the work for v3, I'll add this as something to ensure for that work.

You're correct that for the local-part we can't really do anything because the meaning is entirely up to the receiving system.

@Porges Porges mentioned this issue Jun 3, 2018
24 tasks
@Porges Porges added this to the v3.0 milestone Jun 27, 2018
@ddssff
Copy link

ddssff commented Feb 27, 2020

I don't quite understand how a ByteString can be case insensitive.

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

3 participants