fix(lib): use unboxed closures in `from_fn` constructors