query
On this page

functionArgs

lib.functionArgs

Docs pulled from | This Revision | about 1 hour ago


Extract the expected function arguments from a function. This works both with nix-native { a, b ? foo, ... }: style functions and functions with args set with 'setFunctionArgs'. It has the same return type and semantics as builtins.functionArgs. setFunctionArgs : (a → b) → Map String Bool.

Inputs

f

1. Function argument

(lib.trivial.functionArgs)

Noogle detected

Aliases

Implementation

The following is the current implementation of this function.

functionArgs = f:
    if f ? __functor
    then f.__functionArgs or (functionArgs (f.__functor f))
    else builtins.functionArgs f;