Re:Never patterns, exhaustive matching, and uninhabited type...
by danidiaz on Saturday August 18, 2018 @10:33AM
(#17788620)
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.
By choosing an unhabited return type, you can express that the stream never stops producing values by itself.