Repository navigation
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
BREAKING CHANGE: value searches (elem, notElem, elemIndex, includes, indexOf, lastIndexOf) now take (x, xs). scanr and scanr1 call fn(acc, x, i, xs). Generators yield items, not growing lists. unionBy takes eq(a, b). difference removes one occurrence per item. lines, words, unlines, mapAccumR, groupBy, nubBy, splitAt, intercalate and take change results. See md/MIGRATION_V2.md. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
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.
Closes #152. Compares every exported
fjlmethod that has a Haskell counterpart againstbase-4.22.0.0, and fixes the differences that weren't deliberate. The full inventory is inmd/issues/HASKELL_PARITY.md, and every breaking change is inmd/MIGRATION_V2.md.GHC wasn't available, so expected values come from the examples and laws in the pinned docs, not from running Haskell.
Rules applied
fjlargument and callback order, sofoldrstaysop(acc, x, i, xs).stripPrefixkeeps returning it rather thanundefined.Breaking changes
Most of these change results without throwing, so they're listed under "Check these first" in the migration notes.
elem,notElem,elemIndex,includes,indexOf,lastIndexOf, and their$forms(xs, x)(x, xs)scanr,scanr1fn(x, acc, i, xs)fn(acc, x, i, xs), likefoldrrepeat,cycle,iterate,replicateIter,unfoldrItertake(3, repeat(17))gives[17, 17, 17]cycle([])[]forevertaken + 1itemsnmapAccumRgroupBynubBypred(item, kept)pred(kept, item)splitAt[[], xs]intercalate(',', [])[]''lineslines('one\n')gave['one', '']['one'], andlines('')gives[]wordsunlines'a\nb''a\nb\n'unionBypred(accumulatedList, x)eq(a, b)unionNaNequalled itself===difference(xs ++ ys) \\ xs == ysholdsnub,nubBy,union,unionBy,intersect,intersectBy,differenceBugs fixed
replicatethrew on a negative count.concat([])returnedundefined.remove,removeByandremoveFirstsBycouldn't match a surrogate pair in a string.fjl-validator'sdefaultValueObscurerreturned"*,*,*,**,*,*,**,*,*,*"for'abc', and now gives"***". No test checked its output, so this adds one.Worth checking
includes(xs, 'a')with a string asxschecks whether'a'contains that string and returnsfalse.lines: still counts\r,\r\nand\n\ras one line break, as its doc comment promised. Haskell would keep the\r.complement: has no counterpart, so it still removes every occurrence, unlikedifference.Follow-ups
take,filter,mapand others.Testing
All 1,632 tests pass, and the build and lint have no errors.
tscstill reports errors infjl-labsand infjl-validator-recaptcha's tests, neither of which this changes. New tests check the documented examples and laws where the docs give them.🤖 Generated with Claude Code