bynk.types.stream_not_comparable
Error A Stream value is compared with ==/!= — a stream is a live value-over-time source, not a comparable value (real-time track slice 0).
A Stream is a source of values over time, read once, so two of them have no value to compare. == on one, or on a type that holds one, is refused. Read the streams first, with collect, and compare the lists, or compare the data each was built from. Functions and effects have bynk.types.not_comparable, and a held connection has bynk.types.held_not_comparable.
Example
fn same(a: Stream[Int], b: Stream[Int]) -> Bool { a == b // ✗ a stream has no value to compare}
fn same(a: Stream[Int], b: Stream[Int]) -> Effect[Bool] { let xs <- a.collect() // ✓ read them first let ys <- b.collect() Effect.pure(xs == ys)}In the Book
See also
- Every code in its category, Type checking, on the diagnostic index.
bynk explain bynk.types.stream_not_comparableshows the same from the installed toolchain, without a network.