-
Notifications
You must be signed in to change notification settings - Fork 217
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
Users cannot omit fields of a record. #225
Comments
As |
I should note that this is possible, in a sense, using the current version of Dhall. What changes here is that you can no longer provide a canonical type of the expression that your users give you. The process is essentially:
It's in the last step that you can start to do things like: case expr of
RecordLit fields -> do
myFoo <-
case Map.lookup "foo" fields of
Just fooExpr -> Just <$>_ fooExpr
Nothing -> return Nothing Does that make sense? The difference here is that you aren't using |
Yeah, the main issue here is that you would no longer be able to infer a canonical type for a expression I recommend instead providing a record where all the
|
Here is my above mentioned approach explored in the context of I must admit, I find it quite compelling, even at the cost of losing a canonical type. |
I think |
I've opened dhall-lang/dhall-to-cabal#12 to continue that discussion, rather than hijack @vmchale's original question. |
Great, thanks! This should work well enough for now :) |
I quite like Dhall from what I've seen so far. However, one of the pain points I noticed (compared to TOML) is that the user cannot simply omit a field of a record. If library authors were able to make values of type
Maybe Text
and have these omitted when writing the actual configuration, it would be much easier for users down the line.Thanks for all the work on this language! I'm using it in a project and am excited to see where it goes :)
The text was updated successfully, but these errors were encountered: