Merged
Conversation
Contributor
Author
|
Tada, all checks have passed! |
Bodigrim
reviewed
Apr 12, 2024
Contributor
Bodigrim
left a comment
There was a problem hiding this comment.
Thanks for writing benchmarks!
b653fe4 to
b425505
Compare
Bodigrim
reviewed
Apr 14, 2024
b425505 to
c314ce2
Compare
Lysxia
approved these changes
Apr 16, 2024
kindaro
commented
Apr 17, 2024
kindaro
added a commit
to kindaro/text
that referenced
this pull request
Apr 21, 2025
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)
kindaro
added a commit
to kindaro/text
that referenced
this pull request
Apr 21, 2025
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
Contributor
Author
|
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. |
Contributor
Author
|
@Bodigrim At your service! >λ= What do we do with the failed checks? What are my next steps? |
Contributor
Contributor
|
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
Contributor
Author
|
I am not sure what was expected, but I see less rather than more… |
Lysxia
approved these changes
Apr 22, 2025
Contributor
Lysxia
left a comment
There was a problem hiding this comment.
All good. I see the same speedup in the benchmarks. This is a great PR.
CI failure is unrelated.
Lysxia
pushed a commit
that referenced
this pull request
Apr 22, 2025
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)
Contributor
|
Thanks @kindaro! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Resolve #288.
There are two commits here.
Puresection: one forsconcatand one forstimes.sconcatandstimesto the instance ofSemigroupfor strictText.The benchmarks can be run like so:
This will take a few minutes. You should see better times almost everywhere — only the
tiny.sconcatwill show worse times.This is the report as seen on my machine: