-
Notifications
You must be signed in to change notification settings - Fork 90
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Split and move @num.Num
into @math.Num
parts
#165
Conversation
Important Auto Review SkippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the WalkthroughThe recent changes involve a reorganization and enhancement of numerical operations within the project. Key modifications include the removal of the Changes
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Review Status
Configuration used: CodeRabbit UI
Files selected for processing (12)
- double/double.mbt (2 hunks)
- double/moon.pkg.json (1 hunks)
- int/int.mbt (1 hunks)
- int/moon.pkg.json (1 hunks)
- int64/int64.mbt (1 hunks)
- int64/moon.pkg.json (1 hunks)
- math/README.md (1 hunks)
- math/arithmetic.mbt (1 hunks)
- math/moon.pkg.json (1 hunks)
- math/test.mbt (1 hunks)
- ref/moon.pkg.json (1 hunks)
- ref/ref.mbt (1 hunks)
Files skipped from review due to trivial changes (3)
- double/double.mbt
- double/moon.pkg.json
- int64/int64.mbt
Additional Context Used
Additional comments not posted (11)
int/moon.pkg.json (1)
1-6
: The removal of"moonbitlang/core/num"
from the imports aligns with the PR's objective to decompose theNum
trait into more granular components. This change is consistent and well-implemented.int64/moon.pkg.json (1)
1-6
: > 📝 NOTEThis review was outside the diff hunks and was mapped to the diff hunk with the greatest overlap. Original lines [1-7]
The removal of
"moonbitlang/core/num"
from the imports is consistent with the PR's objective and is well-implemented.math/README.md (1)
1-6
: The README provides a clear and concise overview of themath
module's purpose, aligning with the PR's objectives to introduce more granular arithmetic traits.ref/moon.pkg.json (1)
2-8
: > 📝 NOTEThis review was outside the diff hunks and was mapped to the diff hunk with the greatest overlap. Original lines [1-9]
Updating the import statement from
"moonbitlang/core/num"
to"moonbitlang/core/math"
is consistent with the PR's objectives to decompose theNum
trait and introduce more granular arithmetic traits.math/moon.pkg.json (1)
3-10
: > 📝 NOTEThis review was outside the diff hunks and was mapped to the diff hunk with the greatest overlap. Original lines [1-9]
Adding declarations for
int
andint64
to the list of imported modules aligns with the PR's objectives to integrate these numeric types with the new arithmetic traits.int/int.mbt (1)
47-49
: > 📝 NOTEThis review was outside the diff hunks, and no overlapping diff hunk was found. Original lines [1-30]
The removal of the
test_num
function and its associated test case aligns with the PR's objectives to decompose theNum
trait and introduce more granular arithmetic traits. This change is well-implemented.math/test.mbt (1)
1-49
: The introduction of new test cases for arithmetic operations aligns with the PR's objectives to introduce more granular arithmetic traits. This change is well-implemented and ensures that the new functionality is properly tested.math/arithmetic.mbt (1)
89-120
: > 📝 NOTEThis review was outside the diff hunks and was mapped to the diff hunk with the greatest overlap. Original lines [1-120]
The introduction of new traits for arithmetic operations aligns with the PR's objectives to decompose the
Num
trait into more granular components. This change is well-implemented and enhances the modularity and flexibility of numeric type implementations.ref/ref.mbt (3)
115-117
: Theincr
function has been updated to use the@math.FromInt + @math.Add
traits for its type constraints, which aligns with the PR's objective to make numeric operations more modular. However, it's important to ensure that all numeric types that will use this function implement these traits. Additionally, the use of@math.FromInt::from_int(1)
as a default value for thevalue
parameter is a good practice, as it ensures type safety and consistency.
123-125
: Similar to theincr
function, thedecr
function now uses the@math.FromInt + @math.Subtract
traits for its type constraints. This change supports the PR's goal of decomposing theNum
trait into more granular components. The default value handling through@math.FromInt::from_int(1)
is consistent with theincr
function, promoting uniformity in the API. It's crucial that all numeric types intended to work withdecr
implement the required traits.
115-117
: While the changes to theincr
anddecr
functions are aligned with the PR's objectives, it's essential to verify that the new trait constraints do not introduce any regressions or compatibility issues with existing code that uses these functions. This can be partially addressed through comprehensive testing, but a broader codebase review might be necessary to ensure all dependent code has been updated accordingly.Also applies to: 123-125
eb05faf
to
c8ec8e2
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #165 +/- ##
==========================================
- Coverage 84.71% 84.49% -0.23%
==========================================
Files 76 74 -2
Lines 2865 2863 -2
==========================================
- Hits 2427 2419 -8
- Misses 438 444 +6 ☔ View full report in Codecov by Sentry. |
feel free to reopen it if you have continued interest |
Sure, though, this has now been moved to X, right? |
As mentioned in #36, this PR proposes breaking down the
Num
trait into finer pieces so that the implementations don't always have to fulfill the completeNum
trait.Refs #49