Skip to content
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

feat: Add nat type #254

Merged
merged 9 commits into from
Jun 24, 2024
Merged

feat: Add nat type #254

merged 9 commits into from
Jun 24, 2024

Conversation

mark-koch
Copy link
Collaborator

Closes #228

@mark-koch mark-koch requested a review from doug-q June 20, 2024 13:03
Copy link
Contributor

@doug-q doug-q left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't understand what how the width of nat and int are handled.
I don't understand what is_to_u and iu_to_s are expected to do. If widths aren't changing aren't they the identity?

Approving as this matches int.

@mark-koch
Copy link
Collaborator Author

I don't understand what how the width of nat and int are handled.

Guppy currently assumes that ints are 64 bit across the board, so int_op automatically inserts a log width of 6.

I don't understand what is_to_u and iu_to_s are expected to do. If widths aren't changing aren't they the identity?

I guess they could be, but I'd prefer to error when trying to convert a negative int to nat, or when trying to convert a nat that is too large to fit into an int64.

Base automatically changed from feat/numeric-tys to main June 24, 2024 16:03
@mark-koch mark-koch force-pushed the feat/nats branch 2 times, most recently from 0d37aef to b664d2c Compare June 24, 2024 16:31
@codecov-commenter
Copy link

Codecov Report

Attention: Patch coverage is 95.30686% with 13 lines in your changes missing coverage. Please review.

Please upload report for BASE (main@b2901d8). Learn more about missing BASE report.
Report is 1 commits behind head on main.

Current head 0d37aef differs from pull request most recent head b664d2c

Please upload reports for the commit b664d2c to get more accurate results.

Files Patch % Lines
guppylang/prelude/_internal.py 72.97% 10 Missing ⚠️
guppylang/checker/core.py 80.00% 2 Missing ⚠️
guppylang/tys/ty.py 96.96% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main     #254   +/-   ##
=======================================
  Coverage        ?   90.88%           
=======================================
  Files           ?       44           
  Lines           ?     4937           
  Branches        ?        0           
=======================================
  Hits            ?     4487           
  Misses          ?      450           
  Partials        ?        0           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@mark-koch mark-koch merged commit a461a9d into main Jun 24, 2024
3 checks passed
@mark-koch mark-koch deleted the feat/nats branch June 24, 2024 16:46
github-merge-queue bot pushed a commit that referenced this pull request Jul 2, 2024
🤖 I have created a release *beep* *boop*
---


## [0.6.0](v0.5.2...v0.6.0)
(2024-07-02)


### Features

* Add array type ([#258](#258))
([041c621](041c621))
* Add nat type ([#254](#254))
([a461a9d](a461a9d))
* Add result function
([#271](#271))
([792fb87](792fb87)),
closes [#270](#270)
* Allow constant nats as type args
([#255](#255))
([d706735](d706735))
* Generate constructor methods for structs
([#262](#262))
([f68d0af](f68d0af)),
closes [#261](#261)
* Return already-compiled hugrs from `GuppyModule.compile`
([#247](#247))
([9d01eae](9d01eae))
* Turn int and float into core types
([#225](#225))
([99217dc](99217dc))


### Bug Fixes

* Add missing test file
([#266](#266))
([75231fe](75231fe))
* Loading custom polymorphic function defs as values
([#260](#260))
([d15b2f5](d15b2f5)),
closes [#259](#259)

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add a type for unsigned integers
3 participants