| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Dhall.Lint
Contents
Description
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
letbindings withremoveUnusedBindings. - fixes
let a = x ≡ yto belet a = assert : x ≡ y - consolidates nested
letbindings to use a multiple-letbinding withremoveLetInLet - fixes paths of the form
./../footo../foo - Replaces deprecated
Optional/foldandOptional/buildbuilt-ins
fixAssert :: Expr s a -> Maybe (Expr s a) Source #
Fix Let bindings that the user probably meant to be asserts
fixParentPath :: Expr s Import -> Maybe (Expr s Import) Source #
This transforms ./../foo into ../foo