View Source Bindable.Empty protocol (Bindable v1.1.0)

"Type class" to represent a failed or empty computation.

Informally, it defines "filtering" semantics for your type. By implementing it you enable guards inside for-comprehension for your type.

Inspired by Alternative's empty.

Link to this section Summary

Types

t()

All the types that implement this protocol.

Functions

Provides a default or fallback value in cases where a computation fails or has no result.

Link to this section Types

@type t() :: term()

All the types that implement this protocol.

Link to this section Functions

@spec of(example :: m(a)) :: empty_value :: m(a)

Provides a default or fallback value in cases where a computation fails or has no result.

Returns an "empty"-value of the type provided by example.