Repository navigation
v0.13.0
Added
- source:
range_strictandrange_descending— directional
siblings ofsource.rangethat fail loudly on swapped arguments.
range_strict(from:, to:)returnsError(DescendingNotAllowed)
whenfrom > to, andrange_descending(from:, to:)returns
Error(AscendingNotAllowed)whenfrom < to. Reach for these
when the caller's intent is directional (buffer indices, time
bounds, paginated offsets) and a swapped pair of inputs should
surface as an error rather than a silent backwards stream.
from == tostays the empty-stream success case on both. (#210)
Documentation
- source.range: hoisted the "argument order signals direction"
surprise out of the long docstring into a dedicated
## Surprising behaviourcallout, with explicit cross-links to
gleam/int.range(stop-EXCLUSIVE, rejectsfrom > to) and
gleam/list.range(stop-INCLUSIVE, direction-implicit) so users
coming from the stdlib can see at a glance which convention
source.rangefollows. (#210)
Install
gleam add datastreamSee HexDocs for the API
reference.