Repository navigation
Conversation
|
I'm happy to have a While
Sorry if this sounds discouraging. Unfortunately breaking changes in |
Good.
I've renamed my new
Removed that part of the change.
Well, isn't that the same as saying that if
Isn't the process of deprecating over a long enough time frame a huge reduction of that pain? |
|
It will be the maintainers of @Lysxia what do you think? |
|
I've managed to give a first look at test failures. Beside the fact that
splitOnNE :: HasCallStack
=> Text
-- ^ String to split on. If this string is empty, an error
-- will occur.
-> Text
-- ^ Input text.
-> NonEmptyList.NonEmpty Text
splitOnNE pat@(Text _ _ l) src@(Text arr off len)
| null pat = emptyError "splitOnNE"
…
…
…And to avoid code duplication, I changed the implementation of splitOn pat = NonEmptyList.toList . splitOnNE patbut this would cause test failures in GHC < 9.14, e.g. for 9.12.2: Changing splitOn pat src
| null pat = emptyError "splitOn" -- XXX Why if I comment this tests fail?
| otherwise = NonEmptyList.toList $ splitOnNE pat srcfixes the tests (at least those I've run locally). I don't understand why, given I am |
|
I think that's because of different laziness properties. Tests evaluate results before comparison, but only to a week normal form. In one case the error is immediate, in another it only pops once you start looking inside |
|
I think if we added
The situation with
The tests fail with older base indeed because |
phadej
left a comment
There was a problem hiding this comment.
The additions/changes are wrong.
Addition of examples/doctests should not affect the actual code. There is no OverloadedStrings needs in the implementation, thus the extension doesn't need to be enabled.
Also :seti is there specifically to not interfere with code loading. Don't change.
While I'm not a text maintainer, i'm not happy to see a change with some irrelevant changes. Please cleanup the patch.
Bodigrim
left a comment
There was a problem hiding this comment.
Thanks for your work on this issue! I have a few suggestions.
This PR is somewhat in line with the spirit of #558.
Specifically, like that PR introduced
initsNE/tailsNEas variants ofinits/tailsthat returnNonEmpty Textinstead of[Text](for both lazy and strict modules), this change is introducingsplit'/splitOn'as variants ofsplit/splitOnthat returnNonEmpty Textinstead of[Text](for both lazy and strict modules).Furthermore, I'm proposing to substitute, at some point in the future,
split/splitOnwith thesplit'/splitOn'that I'm introducing now. In this view, the present PR represents step 1 in the following plan:split/splitOnand introducesplit'/splitOn'that aim to eventually substitute them;split/splitOn's implementations to simply forward call the newsplit'/splitOn'and turn themNE.toLists; this way existing tests should be enough;split/splitOn→split'/splitOn';split/splitOninto synonyms ofsplit'/splitOn', and deprecate the latter;split'/splitOn'for good.Additionally, I'm also proposing to rename
initsNE/tailsNEtoinits'/tails', and deprecate all ofinitsNE/tailsNE/inits/tails, starting the same plan as I proposed forsplit/splitOn.I've kept the change split in a few commits to make it easier to inspect and, possibly, drop something.