dhall-lang / dhall-haskell

Maintainable configuration files
https://dhall-lang.org/
BSD 3-Clause "New" or "Revised" License
911 stars 211 forks source link

`dhall start-refactor` proposal #1856

Open german1608 opened 4 years ago

german1608 commented 4 years ago

I was doing a refactor on the Prelude (https://github.com/dhall-lang/dhall-lang/pull/1026) and I see that it could be useful to have a dhall start-refactor command that:

  1. When execute it on a --file, it will listen to all the files related on the imports (if any).
  2. When a file is saved, the hash will be recomputed and shown at screen, showing if there is a difference with the initial hash before doing any changes.

There is the watch unix command but it doesn't say if there was a difference through the time of editing.

Gabriella439 commented 4 years ago

@german1608: Yeah, I think this would be useful! In addition to displaying the hash, it might also be worth recording the old expression in memory and comparing against the new expression using Dhall.Diff