Int bottom is not safe

Open
#312 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

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

Research direction

The issue links to src/Data/Bounded.js lines 1–2, where the Int bounds are listed. Read the Int Ring instance and check how its bottom value behaves under negation; the issue notes that negate bottom == bottom. Done means the lower bound is safe for the Ring instance.

Written by the indexing model from the issue text.

Description

https://github.com/purescript/purescript-prelude/blob/f4cad0ae8106185c9ab407f43cf9abf05c256af4/src/Data/Bounded.js#L1-L2

The bottom and top values for Int are listed as above. The problem here is that -bottom is greater than top, which means bottom is actually not a safe value for the Ring instance of Int. You can verify for yourself that negate bottom == bottom!

Dominant language
PureScript
Stars
168
Forks
90
Avg merge
3d 1h
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-prelude

All issues in purescript/purescript-prelude

Similar issues

More Backend & API Design issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.