lib.trivial
lib.trivial.applyIfFunction
Apply a function to a value if it is also a function.
Type
applyIfFunction :: ((a -> b) -> c) -> (a -> b) -> c
applyIfFunction :: ((a -> b) -> c) -> d -> d
Arguments
Usage
{inputs, ...}: let
inherit (inputs.nix-config.lib.trivial) applyIfFunction;
in # ...
Source
lib.trivial.bindArgs
Bind arguments to a function. This wraps the function in another function that applies specialArgs when called.
Type
bindArgs :: a -> (b -> c) -> (d -> c)
Arguments
- specialArgs
- Arguments to bind to the function.
- fn
- Function to bind to.
Usage
{inputs, ...}: let
inherit (inputs.nix-config.lib.trivial) bindArgs;
in # ...
Source
lib.trivial.bindIntersectArgs
Bind arguments to a function, passing only arguments the function explicitly takes. This wraps the function in another function that applies the attributes of specialArgs present in the function’s parameter list when called.
Type
bindIntersectArgs :: a -> (b -> c) -> (d -> c)
Arguments
- specialArgs
- Arguments to bind to the function.
- path
- Function to bind to.
Usage
{inputs, ...}: let
inherit (inputs.nix-config.lib.trivial) bindIntersectArgs;
in # ...
Source
lib.trivial.callIntersectArgs
Calls a function, passing only arguments the function explicitly takes. This calls the function with the attributes of specialArgs present in the function’s parameter list.
Type
callIntersectArgs :: a -> (b -> c) -> (d -> c)
Arguments
- specialArgs
- Arguments to pass to the function.
- path
- Function to call.
Usage
{inputs, ...}: let
inherit (inputs.nix-config.lib.trivial) callIntersectArgs;
in # ...