Module ra_seq

Data Types

iter()

abstract datatype: iter()

state()

state() = [ra:index() | ra:range()]

Function Index

add/2adds two sequences together where To is the "lower" sequence.
append/2
expand/1
first/1
floor/2This operation is O(n) + a list:reverse/1.
fold/3
from_list/1
has_overlap/2Check if any element in the sequence overlaps with the given range.
in/2
in_range/2
iterator/1
last/1
length/1
limit/2
list_chunk/2Returns a chunk of up to ChunkSize expanded indices from the sequence without eagerly expanding the entire sequence.
next/1
range/1
remove_prefix/2
subtract/2

Function Details

add/2

add(Add::state(), To::state()) -> state()

adds two sequences together where To is the "lower" sequence

append/2

append(Idx::ra:index(), Rem::state()) -> state()

expand/1

expand(Seq::state()) -> [ra:index()]

first/1

first(Seq::state()) -> undefined | ra:index()

floor/2

floor(FloorIdxIncl::ra:index(), Seq::state()) -> state()

This operation is O(n) + a list:reverse/1

fold/3

fold(Fun::fun((ra:index(), Acc) -> Acc), Acc, Seq::state()) -> Acc

from_list/1

from_list(L::[ra:index()]) -> state()

has_overlap/2

has_overlap(Range::ra:range(), Seq::state()) -> boolean()

Check if any element in the sequence overlaps with the given range. This is a pure query that does not modify the sequence and can terminate early as soon as an overlap is found. Sequences are ordered high -> low, so we traverse from highest to lowest.

in/2

in(Idx, Rem) -> any()

in_range/2

in_range(Range::ra:range(), Seq0::state()) -> state()

iterator/1

iterator(Seq::state()) -> iter() | end_of_seq

last/1

last(Seq::state()) -> undefined | ra:index()

length/1

length(Seq) -> any()

limit/2

limit(CeilIdxIncl::ra:index(), Rem::state()) -> state()

list_chunk/2

list_chunk(ChunkSize::pos_integer(), Seq::state() | iter()) -> {[ra:index()], iter()} | end_of_seq

Returns a chunk of up to ChunkSize expanded indices from the sequence without eagerly expanding the entire sequence. On first call, pass a state(). On subsequent calls, pass the returned iterator. Returns {Chunk, NewIterator} or end_of_seq when exhausted. Indices are returned in ascending order.

next/1

next(I::iter()) -> {ra:index(), iter()} | end_of_seq

range/1

range(Seq::state()) -> ra:range()

remove_prefix/2

remove_prefix(Prefix::state(), Seq::state()) -> {ok, state()} | {error, not_prefix}

subtract/2

subtract(Min::state(), Sub::state()) -> Diff::state()


Generated by EDoc