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

prelude: Add Natural comparison functions #674

Merged
merged 16 commits into from
Aug 16, 2019
Merged

prelude: Add Natural comparison functions #674

merged 16 commits into from
Aug 16, 2019

Conversation

ocharles
Copy link
Member

Adds Natural/lt, Natural/lte, Natural/eq, Natural/gte, Natural/gt

Prelude/Natural/gte Outdated Show resolved Hide resolved

let gte
: Natural → Natural → Bool
= λ(x : Natural) → λ(y : Natural) → Bool/not (lt x y)
Copy link
Collaborator

@sjakobi sjakobi Jul 29, 2019

Choose a reason for hiding this comment

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

It should be a bit more efficient to implement this analogously to along the lines of lte.

Copy link
Collaborator

Choose a reason for hiding this comment

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

@ocharles Did you see my comment above?

Copy link
Member Author

Choose a reason for hiding this comment

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

I did, but I don't have the time to change it now. I'm happy to take a PR to this PR though!

Prelude/Natural/gte Outdated Show resolved Hide resolved
@ocharles
Copy link
Member Author

ocharles commented Aug 2, 2019

@Gabriel439 Can I update the dhall executable to be master HEAD? Or should I wait until a new release?

@Gabriella439
Copy link
Contributor

@ocharles: Yeah, you can update the dhall executable at any time. You don't need to wait for a release

@ocharles
Copy link
Member Author

ocharles commented Aug 5, 2019

Ok, I believe this is good to go.

@sjakobi
Copy link
Collaborator

sjakobi commented Aug 5, 2019

Also, can you turn the examples into asserts?

? ./greaterThanEqual
, greaterThan =
./greaterThan sha256:f702abcdfcd7ad73619b9285d7e41c3a1d017fb6b8d037cf40bd93bf30c09b2c
? ./greaterThan
Copy link
Collaborator

Choose a reason for hiding this comment

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

Apparently this record was previously formatted with ascending keys – not sure whether that's actually important…

@ocharles
Copy link
Member Author

ocharles commented Aug 5, 2019

Also, can you turn the examples into asserts?

Good idea!

Copy link
Contributor

@Gabriella439 Gabriella439 left a comment

Choose a reason for hiding this comment

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

Sorry, I forgot to vote on this! I approve the change regardless of what names we use

@ocharles ocharles merged commit 85fb156 into master Aug 16, 2019
@ocharles ocharles deleted the prelude-natural branch August 16, 2019 08:42
philandstuff added a commit to philandstuff/dhall-lang that referenced this pull request Aug 22, 2019
PR dhall-lang#674 added new functions to the prelude without updating this test,
which now fails.  This fixes it.
philandstuff added a commit that referenced this pull request Aug 24, 2019
PR #674 added new functions to the prelude without updating this test,
which now fails.  This fixes it.
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.

5 participants