3 ms·
Types that represent producers of data often return a special result value at the end, of a type different from the values that are yielded. Say, a stream of in
by danidiaz 8y ago
Types that represent producers of data often return a special result value at the end, of a type different from the values that are yielded. Say, a stream of integers that return a Boolean when it's exhausted.
By choosing an unhabited return type, you can express that the stream never stops producing values by itself.