Add dhall lint support for removing constructors (#701)

Now that `constructors x` is the same as `x` we can have `dhall lint`
safely strip all uses of `constructors` in preparation for removing the
keyword entirely.
This commit is contained in:
Gabriel Gonzalez 2018-11-27 14:32:33 -08:00 committed by GitHub
parent 92a68efcd3
commit 103e2e637a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -19,6 +19,7 @@ import qualified Dhall.Core
* removes unused @let@ bindings
* consolidates nested @let@ bindings to use a multiple-@let@ binding
* switches legacy @List@-like @Optional@ literals to use @Some@ / @None@ instead
* removes the `constructors` keyword
-}
lint :: Expr s Import -> Expr t Import
lint expression = loop (Dhall.Core.denote expression)
@ -234,9 +235,7 @@ lint expression = loop (Dhall.Core.denote expression)
b' = loop b
c' = fmap loop c
loop (Constructors a) =
Constructors a'
where
a' = loop a
loop a
loop (Field a b) =
Field a' b
where