Generating default optional values for schemas package


#1

As a configuration schema packages maintainer, I often do the same things to manage the schemas with default optional values. For example, to convert this type definition:

-- types/test.dhall
{ name: Text
, become : Optional Bool
, task : Optional ./task.dhall
}

To this default record:

-- defaults/test.dhall
{ become : None Bool
, task : None ../types/task.dhall
}

And this schemas:

-- schemas/test.dhall
{ Type = ../types/test.dhall
, default = ../defaults/test.dhall
}

I recently investigated using shake build to do the above with this Shakefile.

Would such a tool be useful as a standalone cli or library? If so, any suggestions to improve my Haskell implementation would be very much appreciated, in particular, I had difficulty processing Embed Import values.