Safe Haskell | None |
---|---|

Language | Haskell2010 |

This module contains the implementation of the `dhall lint`

command

## Synopsis

- lint :: Expr s Import -> Expr s Import
- removeUnusedBindings :: Eq a => Expr s a -> Maybe (Expr s a)
- fixAssert :: Expr s a -> Maybe (Expr s a)
- fixParentPath :: Expr s Import -> Maybe (Expr s Import)
- removeLetInLet :: Expr s a -> Maybe (Expr s a)
- replaceOptionalBuildFold :: Expr s a -> Maybe (Expr s a)
- replaceSaturatedOptionalFold :: Expr s a -> Maybe (Expr s a)

# Lint

lint :: Expr s Import -> Expr s Import Source #

Automatically improve a Dhall expression

Currently this:

- removes unused
`let`

bindings with`removeUnusedBindings`

. - fixes
`let a = x ≡ y`

to be`let a = assert : x ≡ y`

- consolidates nested
`let`

bindings to use a multiple-`let`

binding with`removeLetInLet`

- fixes paths of the form
`./../foo`

to`../foo`

- Replaces deprecated
`Optional/fold`

and`Optional/build`

built-ins

fixAssert :: Expr s a -> Maybe (Expr s a) Source #

Fix `Let`

bindings that the user probably meant to be `assert`

s

fixParentPath :: Expr s Import -> Maybe (Expr s Import) Source #

This transforms `./../foo`

into `../foo`