dhall-lang / dhall-to-cabal

Compile Dhall expressions to Cabal files
MIT License
100 stars 19 forks source link

Implement --print-default and generate dhall/defaults/*.dhall #105

Closed quasicomputational closed 6 years ago

quasicomputational commented 6 years ago

cabal-to-dhall has recently learned the default values of fields. Now dhall-to-cabal is able to output the default values for each type.

It's error-prone to keep two sources of defaults; they'll inevitably drift and disagree. The solution here is to derive one from the other, and going from a Haskell description of the defaults to Dhall files is quite possible. dhall-to-cabal-meta is a new binary that can generate the dhall/defaults/*.dhall files.

I've chosen to leave the generated files in the repo because it makes bootstrapping and development a little simpler, but they could easily be deleted.

ocharles commented 6 years ago

LGTM!