It'll be fun when we get first-class generators and you can write a simple, imperative function and no helper types and still use this type signature :)
Yeah, in my case I did code.chars().filter_map(...), where it returns a Some() at the end of each complete token. But generators would definitely be a little cleaner!