sorting bags changes order
Nobody has claimed this yet.
- Dominant language
- Macaulay2
- Stars
- 435
- Forks
- 297
- Avg merge
- 4d 20h
- Merged PRs (30d)
- 11
Description
My understanding is that the whole point of the type `Bag` is the following line:
```m2
Bag ? Bag := (x,y) -> incomparable -- so we can sort with them
```
But this causes orders to change:
```m2
i64 : last \ sort \\ Bag \ {{2}, {3}}
o64 = {3, 2}
```
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the Bag comparison declaration (`Bag ? Bag := (x,y) -> incomparable`) and reproduce the `last \ sort \ Bag \ {{2}, {3}}` example. Trace how `incomparable` is handled by `sort`, then clarify the intended ordering before changing behavior. Done should include a check that sorting bags does not unexpectedly change their order.
Written by the indexing model from the issue text.
Assessment
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100