Quark.Sequence protocol (Quark v2.3.2) View Source
A protocol for stepping through ordered enumerables
Link to this section Summary
Link to this section Types
Specs
t() :: term()
Link to this section Functions
Specs
The beginning of the sequence.
For instance, integers are generally thought of as centering around 0.
Examples
origin(9)
#=> 0
Specs
The pred
essor in the sequence.
For integers, this is the number below.
Examples
pred(10)
#=> 9
42 |> origin() |> pred() |> pred()
#=> -2
Specs
The succ
essor in sequence.
For integers, this is the number above.
Examples
iex> succ(1)
#=> 2
iex> 10 |> origin() |> succ() |> succ()
#=> 2