Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Expression Nodes

All 18 Constructors

nix-ast tagFieldsDescription
Absparams: Params, body: ExprFunction abstraction (lambda)
Appfunc: Expr, arg: ExprFunction application
Assertcond: Expr, body: ExprAssertion assert cond; body
Binaryop: Text, left: Expr, right: ExprBinary operator
Constantcontents: AtomAtomic constant wrapper
EnvPathcontents: FilePathSearch-path <nixpkgs>
HasAttrexpr: Expr, attrPath: AttrPathHas-attribute check set ? attr
Ifcond: Expr, thenExpr: Expr, elseExpr: ExprConditional
Letbindings: [Binding], body: ExprLet bindings
Listcontents: [Expr]List [ ... ]
LiteralPathcontents: FilePathRelative/absolute path ./foo.nix
SelectdefaultValue: Maybe Expr, expr: Expr, selectPath: AttrPathAttribute selection set.attr or default
Setrecursive: Bool, bindings: [Binding]Attribute set { ... }
Strcontents: StringString expression (wraps String)
Symcontents: VarNameVariable reference
SynHolecontents: VarNameSyntax hole/placeholder
Unaryop: Text, arg: ExprUnary operator
Withnamespace: Expr, body: ExprWith expression with pkgs; ...

Node Hierarchy

Expr
├── Abs
├── App
├── Assert
├── Binary
├── Constant    → wraps Atom (Int, Float, Bool, Null, Uri)
├── EnvPath
├── HasAttr
├── If
├── Let
├── List
├── LiteralPath
├── Select
├── Set
├── Str         → wraps String (DoubleQuoted / Indented)
├── Sym
├── SynHole
├── Unary
└── With

Pages

Primitive Expressions

Function & Application

  • Abs: lambda abstraction
  • App: function application

Control Flow

Data Structures

  • List: list literal
  • Set: attribute set
  • Select: attribute selection

Bindings & Scope

  • Let: local bindings
  • With: bring set into scope

Operations

References & Constants

  • Sym: variable reference
  • Constant: atom wrapper
  • Str: string expression

See Also