cispy/utils

A series of functions meant to operate on the channels that the rest of this library creates and manages.

All of the functions that are here cannot be done with transducers because of the limitations on transducers themselves. Thus, you will not find filter or chunk or take here, as those functions can be done with transducers. (You will find a map here, but this one maps multiple channels into one, which cannot be done with transducers.)

Source:

Namespaces

CispyUtils

Type Definitions

mapper(…inputs) → {*}

Source:

A function that takes a number of values and transforms them into a different value.

Parameters:
Name Type Attributes Description
inputs * <repeatable>

The input values.

Returns:

The output value, calculated based on the input values.

Type
*

predicate(value) → {boolean}

Source:

A function that tests a single input argument, returning true or false according to whether the argument passed the test.

Parameters:
Name Type Description
value *

The value to test.

Returns:

Whether or not the value passed the test.

Type
boolean

reducer(acc, value) → {*}

Source:

A function used to reduce a collection of values into a single value via a reducer function.

Parameters:
Name Type Description
acc *

The accumulated value from the prior reduction step. If this is the first reduction step, this will be set to some initial value (either an explicit value or the first value of the collection).

value *

The next value of the collection.

Returns:

The result of reducing the next value into the current accumulated value.

Type
*