valaddin: valaddin: Functional Input Validation

Description Details

Description

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:

Details

For an example-oriented overview of valaddin, see vignette("valaddin").


egnha/valaddin documentation built on Oct. 6, 2017, 3:58 p.m.