`groupBy` has unexpected `l` argument for `a -> a -> Boolean` predicate

Open
#229 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

  • #230 by @JordanMartinez — closed without merging

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
25/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Domain
backend

Research direction

Start with the linked try.purescript.org example and inspect the groupBy implementation and its tests to trace how the predicate arguments are chosen. The report expects adjacent pairs (0, 1) and (1, 2) for [0, 1, 2]; determine whether the behavior is unintended, then add a regression test and confirm it passes if a change is warranted.

Written by the indexing model from the issue text.

Description

See https://try.purescript.org/?gist=26968458c1261226b33e574128ba9aae

For a given array like [0, 1, 2], I expect the l and r arguments to be

  • first run: 0 and 1
  • second run: 1 and 2

However, in the second run, l is 0 rather than 1.

I'd argue that the behavior here is unexpected.

Dominant language
PureScript
Stars
58
Forks
70
Avg merge
2d 22h
Merged PRs (30d)
1

Getting set up

  • No Dockerfile or Docker Compose file
  • Has a pull request template
  • No contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from purescript/purescript-arrays

All issues in purescript/purescript-arrays

Similar issues

More Backend & API Design issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.