sourceable
[ >!: ]
The sourceable protocol defines how a value should produce a lazy sequence of values.
This differs from the seqable protocol in that sources are not guaranteed to produce the same
values in the same order every time. They may also modify some state in the source itself
(such as mutating the offset of a file descriptor).
The lines between the two protocols are somewhat blurred, as the gab\channel type does implement the seqable
protocol using the sourceable protocol, like so:
[Channels.t] .defmodule {
seq\init: _ :: do
(ok, xs*) := self >!
(ok, nil:, xs*)
end
seq\next: _ :: do
(ok, xs*) := self >!
(ok, nil:, xs*)
end
}
source
sourceable.>!: () :: (success (status ok:, value unknown) | error (status err:, message string) | none none:)
Perform some side-effecting action to obtain a datum.
Since a side-effect is performed (which may fail or present no data), this message returns a result or option.