HORIZON HASKELLDocslts/ghc-9.10.xc74966e2026-09-27Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · c74966e · 2026-09-27

Moduledhall-1.42.3Haskell2010

Dhall.Lint

This module contains the implementation of the dhall lint command

  • 7 values
  • Packagedhall-1.42.3
  • Exports7
  • LanguageHaskell2010
  • LicenceBSD-3-Clause
  • SourceLint.hs

Lint

7 declarations
valuelint :: Eq s => Expr s Import -> Expr s Import
#

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

valueremoveLetInLet :: Expr s a -> Maybe (Expr s a)
#

The difference between

let x = 1 let y = 2 in x + y

and

let x = 1 in let y = 2 in x + y

is that in the second expression, the inner Let is wrapped by a Note.

We remove such a Note in order to consolidate nested let-blocks into a single one.

valueuseToMap :: Expr s a -> Maybe (Expr s a)
#

This replaces a record of key-value pairs with the equivalent use of toMap

This is currently not used by dhall lint because this would sort Map keys, which is not necessarily a behavior-preserving change, but is still made available as a convenient rewrite rule. For example, {json,yaml}-to-dhall use this rewrite to simplify their output.