Don't blindly walk under Lam (fixes #124) #126
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Issue #124 demonstrates a problem where an alpha-normalized expression
no longer works with dhall-to-cabal. For example, a version expression
is
The following is equivalent, because names shouldn't matter:
dhall-to-cabal would fail to extract a version from this expression, as
it walks under two lambdas and then expects to find the exact variable
"v".
Instead, we now take the given expression and fully saturate it with
applications of the variable names we expect.
This same fix has been implied everywhere we were pattern matching on
Lam. Essentially, we should never pattern match on Lam, instead we
should App the variables we need and normalize.
A very tiny unit test suite has been added so we can add tests to types
in the future.