swiss v2.2.0 Swiss View Source

Swiss

Swiss is a bundle of extensions to the standard lib. It includes several helper functions for dealing with standard types.

API

The root module has generic helper functions; check each sub-module's docs for each type's API.

Link to this section Summary

Functions

Applies the given func to value and returns value.

Applies the given func to value and returns its result.

Link to this section Functions

Link to this function

tap(value, func)

View Source
tap(value :: any(), func :: function()) :: any()

Applies the given func to value and returns value.

Examples

iex> Swiss.tap(42, &(12 + &1))
42
Link to this function

thru(value, func)

View Source
thru(value :: any(), func :: function()) :: any()

Applies the given func to value and returns its result.

Examples

iex> Swiss.thru(42, &(12 + &1))
54