valaddin-package | R Documentation |
valaddin provides a functional operator, firmly
, that
enhances functions with input validation. You supply a function f
along with input validation requirements, and firmly
returns a
function that applies f
“firmly”: before a call to f
is
attempted, its inputs are checked, and if any check fails, an error halts
further execution with a message tabulating every failing check. Because
firmly
implements input validation by operating on whole functions
rather than values, it is suitable for both programming and interactive use.
Using firmly
to add input validation to your functions improves the
legibility, reusability, and reliability of your code:
Emphasize the core logic of your functions by excising validation boilerplate.
Reduce duplication by reusing common checks across functions with common input requirements.
Make function outputs more predictable by constraining their inputs.
Vary the strictness of a function according to need and circumstance.
For an example-oriented overview of valaddin, see
vignette("valaddin")
.
Maintainer: Eugene Ha eha@posteo.de
Useful links:
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.