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

first arg is missing in beta-normalization of Natural/build #1244

Merged
merged 2 commits into from Dec 10, 2021

Conversation

hagl
Copy link
Contributor

@hagl hagl commented Dec 1, 2021

I think, I found a small bug in the specification of the beta-normalization.

The beta-normalization of Natural/build should apply g to Natural, succ and zero.
The first of these arguments is currently not provided. Compare with the dhall-haskell implementation: https://github.com/dhall-lang/dhall-haskell/blob/235f38c8048c9a9fee7379d77fc55d179e0d107e/dhall/src/Dhall/Normalize.hs#L220

Copy link
Collaborator

@sjakobi sjakobi left a comment

Choose a reason for hiding this comment

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

I was initially a bit skeptical, because the type argument seemed pointless on first sight. But the type quite clearly requires it, and the example in the Prelude helps illustrate it for me:

let example0 =
assert
: build
( λ(natural : Type)
λ(succ : natural natural)
λ(zero : natural)
succ (succ (succ zero))
)
3

Good catch! 👍

@Gabriella439
Copy link
Contributor

Yeah, this change is definitely correct. The only reason we didn't catch it is because the code in question is not being exercised (yet)

@Gabriella439 Gabriella439 merged commit e8db268 into dhall-lang:master Dec 10, 2021
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.

None yet

3 participants