can't you just slim this line and the next down to `obj = f(obj)`? (otherwise, you're just repeating that type check twice)....