HORIZON HASKELLDocslts/ghc-10.0.xa8896112026-10-18Search names, modules, packages, or :: a typeCtrl K

GHC 10.0.0.20260917 · lts/ghc-10.0.x · a889611 · 2026-10-18

Modulehnix-0.17.0Haskell2010

Nix.Pretty

  • 3 types
  • 28 values
  • 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).

valuewrap :: NOperatorDef -> NixDoc ann -> Doc ann
#

Determine if to return doc wraped into parens, according the given operator.

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