Issue #124 demonstrates a problem where an alpha-normalized expression
no longer works with dhall-to-cabal. For example, a version expression
is
\( Version : Type ) -> \( v : Text -> Version ) -> v "1.0.0"
The following is equivalent, because names shouldn't matter:
\( foo : Type ) -> \( bar : Text -> foo ) -> bar "1.0.0"
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.
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.