egnha / valaddin

Functional input validation to make R functions more readable and robust
Other
33 stars 1 forks source link

Distinguish between closures and functions-in-general #18

Closed egnha closed 7 years ago

egnha commented 7 years ago

To match naive expectations, vld_function should correspond to the predicate base::is.function rather than purrr::is_function. A new checker vld_closure should take the place of vld_function. Thus:

vld_function <- localize("Not function" ~ is.function)
vld_closure  <- localize("Not closure" ~ purrr::is_function)