Adds closure-like capabilities to IterFn.