import type { Fn2 } from "@thi.ng/api" ; remarks example param fn param seed param num export function * iterate < T > ( fn , seed , num = Infinity ) { for ( let i = 1 ; i <= num ; i ++ ) { yield seed ; seed = fn ( seed , i ) ; } }