You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Dhall defaults described in https://hackage.haskell.org/package/dhall-1.41.2/docs/Dhall-Tutorial.html#g:12 is a great help, however it requires adding a lot of optional fields in my use-case, which in my opinion, adds noise.
I can see that this problem has been discussed already in #2434 , and I'd like to follow up with some suggestion for adding a new construct/function to Dhall. I'd like to achieve the benefits of Dhall defaults without having to specify optional fields.
Is it a good idea to add a new construct which desugars into Dhall defaults with optional fields? Let's call the new construct OptValueWithDefault
let ThatValue = OptValueWithDefault({
Type={age: Natural, name:Text, height:Double},
default={age=25}
})
I am working on writing some Elasticsearch queries in Dhall, and defining a value with a lot of parameters can become cumbersome (See https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-match-query.html#match-field-params as an example)
Dhall defaults described in https://hackage.haskell.org/package/dhall-1.41.2/docs/Dhall-Tutorial.html#g:12 is a great help, however it requires adding a lot of optional fields in my use-case, which in my opinion, adds noise.
I can see that this problem has been discussed already in #2434 , and I'd like to follow up with some suggestion for adding a new construct/function to Dhall. I'd like to achieve the benefits of Dhall defaults without having to specify optional fields.
Is it a good idea to add a new construct which desugars into Dhall defaults with optional fields? Let's call the new construct OptValueWithDefault
desugars into
and
will desugar into
Is this an acceptable addition to Dhall?
Best regards,
Hamid
The text was updated successfully, but these errors were encountered: