View Source Euclid.Term (Euclid v0.4.0)

Extra functions for terms.

Link to this section Summary

Functions

Returns true if the term is blank, nil, or empty

Returns value unless it is blank, in which case it returns default

Returns the value if it is present (via present?), or else returns the default value

Returns true if the term is not blank, nil, or empty

Link to this section Functions

Specs

blank?(any()) :: boolean()

Returns true if the term is blank, nil, or empty

Link to this function

or_default(value, default)

View Source

Specs

or_default(any(), any()) :: any()

Returns value unless it is blank, in which case it returns default

Link to this function

presence(term, default \\ nil)

View Source

Specs

presence(any(), any()) :: any()

Returns the value if it is present (via present?), or else returns the default value

Specs

present?(any()) :: boolean()

Returns true if the term is not blank, nil, or empty