Keywords: input validation, type safety, defensive programming, functional programming
Webpages:
https://CRAN.R-project.org/package=valaddin,
https://github.com/egnha/valaddin To cope with the everyday hazards of invalid function inputs,
R provides the functions stop() and stopifnot(), which can express input requirements as show-stopping assertions. While this way of validating inputs is both straightforward and effective, its rigidity as a fixture of a function, and its tendency to clutter code, add inertia to the process of interacting and programming with data.
In this talk, we demonstrate a more nimble take on input validation using the valaddin package, which address these shortcomings by viewing input validation as a
functional transformation. We explore concrete use cases to illustrate the flexibility and benefits of this alternative approach.