This comment has been minimized.

Using new{ def foreach() = ... } in suspendable() creates a structural type which is dispatched with reflection. Depending on the circumstances, that can be rather slow. Create a named trait e.g.
trait GeneratorForeachable[A]{ def foreach( f: A => Unit @suspendable ) }
and create an anyonymous subclass of that in suspendable()