-
Notifications
You must be signed in to change notification settings - Fork 158
Feature: sconcat
and stimes
.
#580
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
Tada, all checks have passed! |
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.
Thanks for writing benchmarks!
b653fe4
to
b425505
Compare
b425505
to
c314ce2
Compare
Why? Li-yao Xia explains: > 1. Asking to "replicate a string n times" with negative n is nonsense. > There must be an error in the definition of n, so throwing an > exception lets users be aware of that error and fix it. > 2. The default definition of `stimes` already throws an exception for `n > <= 0`. People haven't complained about it. Extending the definition > for `n = 0` is reasonable for a monoid. > 3. There could still be a case made in favor of making `stimes` less > partial and more similar to `replicate` (I think "replicate a string > n times" is nonsense as a sentence in natural language, but I don't > have a strong argument that code must follow natural language). Until > someone makes a good case for extending `stimes`, throwing an > exception for negative arguments is forward-compatible: we can extend > the function later (it would only break code that catches the > exception, a fishy thing to do). If we made it total now and changed > our minds later, that would be a more breaking change. haskell#580 (comment)
Why? Li-yao Xia explains: > 1. Asking to "replicate a string n times" with negative n is nonsense. > There must be an error in the definition of n, so throwing an > exception lets users be aware of that error and fix it. > 2. The default definition of `stimes` already throws an exception for `n > <= 0`. People haven't complained about it. Extending the definition > for `n = 0` is reasonable for a monoid. > 3. There could still be a case made in favor of making `stimes` less > partial and more similar to `replicate` (I think "replicate a string > n times" is nonsense as a sentence in natural language, but I don't > have a strong argument that code must follow natural language). Until > someone makes a good case for extending `stimes`, throwing an > exception for negative arguments is forward-compatible: we can extend > the function later (it would only break code that catches the > exception, a fishy thing to do). If we made it total now and changed > our minds later, that would be a more breaking change. haskell#580 (comment)
799fe7c
to
904d5f6
Compare
I resolved all conversations and fixed everything that was talked about. I also rebased on top of the current There are some failing checks that I do not understand and have no idea how to handle. |
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.
Thanks!
@Bodigrim At your service! >λ= What do we do with the failed checks? What are my next steps? |
I merged #631 so you can rebase to see if more of the CI tests pass. |
The constructors of `Integer` and the module they are exported from all changed between GHC 8 and 9.
Why? Li-yao Xia explains: > 1. Asking to "replicate a string n times" with negative n is nonsense. > There must be an error in the definition of n, so throwing an > exception lets users be aware of that error and fix it. > 2. The default definition of `stimes` already throws an exception for `n > <= 0`. People haven't complained about it. Extending the definition > for `n = 0` is reasonable for a monoid. > 3. There could still be a case made in favor of making `stimes` less > partial and more similar to `replicate` (I think "replicate a string > n times" is nonsense as a sentence in natural language, but I don't > have a strong argument that code must follow natural language). Until > someone makes a good case for extending `stimes`, throwing an > exception for negative arguments is forward-compatible: we can extend > the function later (it would only break code that catches the > exception, a fishy thing to do). If we made it total now and changed > our minds later, that would be a more breaking change. haskell#580 (comment)
Haddock does not support comments on instance methods. haskell/haddock#123
904d5f6
to
9f63f10
Compare
I am not sure what was expected, but I see less rather than more… |
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.
All good. I see the same speedup in the benchmarks. This is a great PR.
CI failure is unrelated.
Why? Li-yao Xia explains: > 1. Asking to "replicate a string n times" with negative n is nonsense. > There must be an error in the definition of n, so throwing an > exception lets users be aware of that error and fix it. > 2. The default definition of `stimes` already throws an exception for `n > <= 0`. People haven't complained about it. Extending the definition > for `n = 0` is reasonable for a monoid. > 3. There could still be a case made in favor of making `stimes` less > partial and more similar to `replicate` (I think "replicate a string > n times" is nonsense as a sentence in natural language, but I don't > have a strong argument that code must follow natural language). Until > someone makes a good case for extending `stimes`, throwing an > exception for negative arguments is forward-compatible: we can extend > the function later (it would only break code that catches the > exception, a fishy thing to do). If we made it total now and changed > our minds later, that would be a more breaking change. #580 (comment)
Thanks @kindaro! |
Resolve #288.
There are two commits here.
Pure
section: one forsconcat
and one forstimes
.sconcat
andstimes
to the instance ofSemigroup
for strictText
.The benchmarks can be run like so:
This will take a few minutes. You should see better times almost everywhere — only the
tiny.sconcat
will show worse times.This is the report as seen on my machine: