My application uses the following Dhall type:
{ siteTitle :
Text
, author :
Optional Text
, siteBaseUrl :
Optional Text
, editUrl :
Optional Text
}
The users of my application would use the following as their configuration file (note that no type is specified for this value):
{ siteTitle =
"Srid's Zettelkasten"
, author =
Some "Srid"
, siteBaseUrl =
None Text
, editUrl =
None Text
}
Is there a way to have the users of the application ignore those None
fields? So that they can instead specify:
{ siteTitle =
"Srid's Zettelkasten"
, author =
Some "Srid"
}
I would like this to be possible so that a future version of the application, which may add new fields (optional) to the configuration, would not break when reading existing user configuration (which would not have that field).
If this cannot be done Dhall, I’ll unfortunately have to switch to something else.