# Functions

Map the nil if it is StopIteration, or keep the error otherwise.
StopIteration returns a sentinel error that indicates stopping the iteration.