The discussion of graceful handling of iterators of results (as in lines()
) brings to light again what is, IMO, the fundamental awkwardness of that construction. An iterator that reads from a file is not an iterator of independent Result
s, it’s an iterator that can fail completely, but the type signature conflates the two cases. Rather than trying to paper over the awkwardness there, I think we should look to represent that pattern more accurately, e.g. as previously discussed by @newpavlov.
7 Likes