-
Notifications
You must be signed in to change notification settings - Fork 15
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
Series 2.x.x #247
Comments
👍 thanks for all your work on this. I think a series/2.x is the best path forward for the time being. Since this is an issue about series/2.x in general, I'm thinking we should consider using a newtype for |
@armanbilge Do you just mean |
Yes, this. Which would mean that |
Yeah, so in #232 that changes a bit. I changed the underlying hashCode/equals/compare to be based on a There is still some discussion to have there, but all FWIW, I'm starting to be of the opinion we should be using |
I hope that makes some amount of sense. Rereading my comment makes me feel like I didn't explain that well. This is what I'm talking about: https://github.com/typelevel/case-insensitive/pull/232/files#diff-90a144a03717314cdaa1151276da76557be0f1e78c890580b57c9d95406f95f6R80 |
@armanbilge can you make |
Neither do I :) |
@isomarcte to clarify, my proposal is we replace: final class CIString private (override val toString: String) with opaque type CIString = String If we do this, then the universal hashCode and equals for |
Wait, sorry, I wasn't looking carefully. I see, Edit: wait, nope, I'm confused by all the various implementations 😬 |
Yeah, there are a lot of types in the Unicode standard. For our discussion here we just need to focus on The new encoding of final case class CIString private (original: String, caselessString: CanonicalFullCaseFoldedString) To make a cassless string, in general, you need to case fold it, then normalize it (this is simplified, there can be more steps depending on the type of caseless string). Thus The reason I changed the representation of There are other ways we could do this. We could have the opaque type CIString = String
extension (inline ciString: CIString) {
inline def caselessString: CanonicalFullCaseFoldedString = normalize(caseFold(ciString))
} Then all the methods on All of these gymnastics are the result of us keeping around a reference to the original input string in |
Thanks for the detailed explanation, that makes sense to me. Regarding whether to cache or not, it probably makes sense? Not sure if there are situations where lots of
The FAQ suggests there are Reasons™, but I'm not sure what they are :) |
I added @armanbilge and @isomarcte to the team, so anyone should be able to create the necessary branches. Not keeping the original would be a non-semantic, but highly visible, change to HTTP rendering. For example, all field names would be rendered lower case. I don't know how much uptake |
Here are steward PRs for case-insensitive: Besides http4s, I recognize trace4cats. |
@isomarcte I created a I think some form of source-breaking changes are inevitable (at least in the form of deprecations) since in #232 (comment) we realized many of the exsting APIs are unsound. Personally I think the best strategy to is keep pushing for http4s 1.x, with better CI strings, better URIs, better entities, etc. |
I'm considering targeting #232 to a
series/2.x.x
branch.@rossabaker @armanbilge any objections to me creating that branch and moving the code there?
The text was updated successfully, but these errors were encountered: