higher order flow control functions for creating generators