-
Notifications
You must be signed in to change notification settings - Fork 213
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
Surprising behaviour of StandardVersion #848
Comments
And what does |
@sellout: The standard versions are used exclusively for the binary protocol. For a while they were used to tag encoded expressions but once dhall-lang/dhall-lang#362 was merged then the version was not included in the encoded expression. That's what The reason for those constructors being in that order is that the Haskell implementation tries to support encoded expressions generated by previous versions of the standard. Since new standard versions going forward don't require a version tag for encoded expressions there won't be new standard versions added to that list (i.e. there won't be a That implies two things:
@trskop: Does that answer your question? |
@Gabriel439, thank you for the explanation. I'm really excited about this since it'll simplify migration. (I was one of those that moaned about it in the survey.)
|
@trskop: Yes, baking in the standard version as either |
Data type `StandardVersion` was used to tag binary representation of previous versions of the Dhall Standard. We still need to keep this data type around to support older versions. Starting with version 6.0.0 of the standard this tag is no longer required for encoded expressions. Dhall API uses `StandardVersion` in various places. Instead of removing it entirely from the public API this commit opted to hide data constructors and expose only `defaultStandardVersion`. Dhall command line tool allowed `StandardVersion` to be specified on the command line. After this commit it is no longer possible to do so. issue dhall-lang#848
Closing this as the |
Latest release redefined
StandardVersion
as:Unfortunately, with this definition it is not possible to get latest supported version, of the standard, in a nice way. The
dhall
command fails victim to this as well:My first reaction after seeing that there is a
Bounded
instance available was to usemaxBound :: StandardVersion
. Unfortunately that doesn't work as expected due to ordering of data constructors:These are possible solutions that I came up with:
Enum
andBounded
instances.Enum
andBounded
instances manually.latestSupportedStandardVersion :: StandardVersion
that would, at the moment, point toV_5_0_0
.I'm happy to help with the implementation as well.
The text was updated successfully, but these errors were encountered: