-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Revisit the Or datatype #11
Comments
+1 for option 2 |
|
I'll throw in my 2 cents.
|
However I would like to be intentional about names, comments, and trying to keep things as modular as possible. I would encourage us to consider dropping methods that we aren't sure are needed -- we can easily add them back later. Let's not bring in the kitchen sink if we don't have to. Anyway, just my 2¢. |
👍 to I actually like the unpleasantness of |
I like |
I agree with the above. I'll rebuild this from a clean buffer as with LeftOr and RightOr and resubmit to for further conversation. It's a well-understood type, so it's a good one to help establish the principles and guidelines that @ceedubs mentions. Some specifics, while we're setting precedents:
|
Here's my feelings on this:
|
Implements feedback from typelevel#11. Specifically: 1. LOr and ROr move to `Or.LeftOr` and `Or.RightOr`. 2. Constructors are still public, but `left` and `right` preserved in `OrFunctions` to infer `Or`. Use what you like. 3. Only the Scaladoc is ripped from Scalaz. Also tries to adhere to the emerging consensus on typelevel#27. Preliminar benchmarking showed monomorphism is faster than polymorphism, and that implementing other operations using fold/bimap is immeasurable. The second finding is dubious with respect to allocations. If someone can prove these guilty via benchmark, we can revisit. I'd like to add tests after typelevel#29 happens.
We now have a Or datatype in -data which is mostly lifted straight out of scalaz.
Right now it is
We thought about -Or and Or- for constructors but the compiler seemed unhappy about. I don't think anyone loves the name LOr or ROr, but nobody seems to have a slam-dunk replacement. We're going to move on for now, but the discussion around this raised several questions we should revisit:
Bad | Good
\Or | Or/
Dead | Alive
The text was updated successfully, but these errors were encountered: