query
On this page

toFunction

lib.trivial.toFunction

Docs pulled from | This Revision | 22 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

Noogle also knows

Aliases