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

Params

Constructors

ConstructorFieldsDescription
ParamSetparamSetName: Maybe VarName, variadic: Bool, params: ParamSetParameter set { x, y ? 1, ... }
Paramcontents: VarNameSingle parameter x: ...

Description

Params represents function parameters: either a single parameter (x: body) or a parameter set ({ x, y ? 1 }: body).

The ParamSet constructor contains an inner ParamSet type which is a map of parameter names to optional default expressions.

Pages

Nix Library Access

syntax.mkParam "x"
syntax.mkParamSet null false [["x" null] ["y" null]]
syntax.mkParamSet null false [["x" (syntax.mkInt 1)]]
syntax.mkParamSet null true [["x" null] ["y" null]]