Module tool::prelude[][src]

Useful functions to glob import.

If you don't want all of them, you can also import the prelude of an individual module.

Functions

compose

Compose two functions.

default

Return a default value.

empty

True if the value is "empty"

first

Get the first element of a sequence with at least one element.

fix

A Y-Combinator.

flip

Flip the argument order of a two-parameter function.

id

The identity function.

non_empty

False if the value is "empty"

ok

Converts Result-like values into Options.

second

Get the second element of a sequence with at least to elements

third

Get the third element of a sequence with at least three elements.

uncons

Split a sequence of at least one item into a head and tail.

unwrap

Unwraps the value.