"yield" for Swift, inspired by Python and F#