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

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

fn
Function to apply.
value
Value to apply the function to, if it is also a function.

Usage

{inputs, ...}: let
  inherit (inputs.nix-config.lib.trivial) applyIfFunction;
in # ...

Source

lib/trivial/lib.nix:28

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/lib.nix:50

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/lib.nix:72

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 # ...

Source

lib/trivial/lib.nix:94