-
Notifications
You must be signed in to change notification settings - Fork 219
Import Prelude instead of vendoring the Prelude #639
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
Conversation
This uses Dhall's import system to fetch the Prelude so that we don't have to keep a local copy of it
|
Looks like this uncovered some caching issue? |
|
@sellout: Actually, it was the other way around. The caching was working correctly, and the mismatch identified an issue with the uncached version. The root cause was a violation of the standard in the β-normalization logic. The standard doesn't include the type annotation as part of a non-empty list, meaning that the type annotation is treated as an ordinary type annotation and not one specific to lists. This implies that a non-empty list with a type annotation should normalize to one without a type annotation. The binary encoding logic was correctly stripping the type annotation from non-empty lists, but the ordinary normalization logic was not, which led to a test failure. The Prelude decoded from the cache didn't have the type annotation but the expected test output did. The expected test output was wrong because the type annotation wasn't supposed to be there. |
|
We should probably adjust the /cc @Profpatsch |
|
Is this a problem in practice? The folder still exists and dhall handles the import transparently, right? |
|
@Profpatsch yes, but one would not have the files locally anymore (which is the point of using a Nix install instead of pinning a commit hash from github) |
|
Hm. I think a user might still want the nix output, to use the “official” version of Prelude that comes with the dhall release. No surprises about invalid syntax or other breaking features then. |
|
I'm a little unclear about what is proposed on either side, so I'll restate what I think you both are saying and then chime in with my own thoughts I think @f-f is proposing that https://github.com/dhall-lang/dhall-lang/tree/master/Prelude On the other hand, I think @Profpatsch is proposing that https://github.com/dhall-lang/dhall-haskell/tree/master/Prelude ... which imports a specific revision of the language-agnostic Prelude. My understanding is that the reasoning is that the Prelude attached to the Haskell implementation of Dhall should be the Haskell-specific one, whereas the language-agnostic prelude belongs somewhere else. Now, for my own thoughts: Part of the issue here is that the Haskell implementation took over the top-level Under that scenario, you could have all three of |
|
I’m open to all of these. |
|
Thanks @Gabriel439, good summary. My reasoning for having the language-agnostic Prelude in
|
You are right, that was one of the reasons I added the prelude in the first place. I like Gabriel’s proposal. I’ll submit a PR implementing it. |
|
I’ve got a proposal PR in NixOS/nixpkgs#49116. Instead of just adding the prelude, I think it’s time to push the dhall libraries as a package set. |
This uses Dhall's import system to fetch the Prelude so that we don't have
to keep a local copy of it