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

SynHole (Syntax Hole)

Definition

SynHole VarName

Fields

FieldTypeDescription
contentsVarNameThe hole identifier/name

Description

SynHole is a placeholder in the AST that metaprogramming or code generation fills in later. Typical uses: template generation, building partial ASTs, and code synthesis.

The VarName identifies the hole for later substitution.

Nix Source ↔ AST

There is no direct Nix syntax for SynHole: it is constructed programmatically.

{
  "tag": "SynHole",
  "contents": "myHole"
}

Nix Library Access

syntax.mkSynHole "myHole"