HORIZON HASKELLDocslts/ghc-10.0.x77a86622026-10-31Search packagesCtrl K
Theme: |

GHC 10.0.0.20260917 · lts/ghc-10.0.x · 77a8662 · 2026-10-31

  • Packagehnix-0.17.0
  • Exports31
  • LanguageHaskell2010
  • LicenceBSD-3-Clause
  • SourcePretty.hs
datadata NixDoc ann

This type represents a pretty printed nix expression together with some information about the expression.

Constructors

  • NixDoc
    • getDoc :: Doc ann

      Rendered expression. Without surrounding parenthesis.

    • rootOp :: NOperatorDef

      The root operator is the operator at the root of the expression tree. For example, in '(a * b) + c', + would be the root operator. It is needed to determine if we need to wrap the expression in parentheses.

    • wasPath :: Bool
valuesimpleExpr :: Doc ann -> NixDoc ann

A simple expression is never wrapped in parentheses. The expression behaves as if its root operator had a precedence higher than all other operators (including function application).

valueleastPrecedence :: Doc ann -> NixDoc ann

An expression that behaves as if its root operator had a precedence lower than all other operators. That ensures that the expression is wrapped in parentheses in almost always, but it's still rendered without parentheses in cases where parentheses are never required (such as in the LHS of a binding).

datadata ValueOrigin

During the output, which can print only representation of value, lazy thunks need to looked into & so - be evaluated (*sic) This type is a simple manual witness "is the thunk gets shown".

Instances1Eq