query
On this page

toFunction

lib.toFunction

Docs pulled from | This Revision | 35 minutes ago


Turns any non-callable values into constant functions. Returns callable values as is.

Inputs

v

Any value

Examples

lib.trivial.toFunction usage example

nix-repl> lib.toFunction 1 2
1

nix-repl> lib.toFunction (x: x + 1) 2
3
(lib.trivial.toFunction)

Noogle also knows

Aliases