-
-
Notifications
You must be signed in to change notification settings - Fork 174
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
Support for Blob types? #1179
Comments
Let's call this type of value |
My first suggestion would be to use hexadecimal encodings since they are byte aligned and are the required utf8 encoding needed to be in dhall configs. \xDEADBEEF or something like that. Is it doable in the syntax tree or are there going to be conflicts? |
Here are two possible alternatives that I might suggest for how to encode
|
@Gabriel439 I think I prefer the first option for the following reason: With the
During import resolution the implementation will choose a numeric type to hold the content of Another option that comes to my mind is |
@mmhat: I think the main reason I'd prefer quotations instead of a For example, suppose that we standardize support for bitwise numeric literals as suggested in #1215 (e.g. |
Also, I just realized a reason why a |
@Gabriel439 Interestingly when I wrote about extending the blob type I was thinking more about |
I think the quoted version seems good. From my non-PL-designer POV, I don't have a strong preference for any particular implementation as long as it isn't overly burdensome. And as we all know, it can be quite easy to bikeshed over trivial stuff. If there's no obvious reason not to go with quotations I think we should just do that and call it a day. |
I also have a few interesting use cases to throw out there for a One case is for generating powerpoint files (I'm using Dhall basically anywhere and everywhere I can these days!), which is just a zip of a bunch of XML, for the most part. Using Another case would be for something like CloudFormation for AWS Lambda. A zip file of the code is essentially the deployable unit. In some configurations, it's helpful to have a SHA256 of the zip in the CF itself. If the zip could be imported as bytes and then sha256 was a function from and to Hope these use-cases are helpful! |
* Currently only base-16 represenation * No functions to do something meaningful with Bytes values Fixes dhall-lang#1179
Currently only base-16 encoded literals are supported. Functions to do something meaningful with Bytes values are not in the scope of this proposal. Fixes #1179 --------- Co-authored-by: Gabriella Gonzalez <GenuineGabriella@gmail.com>
Perhaps I'm misunderstanding or misusing this language but I would like to be able to consume a value directly into a Haskell Bytestring. My first idea was to build a decoder that consumed a text value limited to an even number of characters, but I figured since that wasn't already in the library (given it seems like it would be common), I'm guessing that there was a reason to not do this. What is the appropriate way to use non-utf8 values in a dhall config?
The text was updated successfully, but these errors were encountered: