export function* filter( collection: Iterable, predicate: (e: T) => boolean ) { for (const e of collection) { if (predicate(e)) { yield e; } } }