build_parameter_constraint_fns: Build type parameter constraints

View source: R/type_parameters.R

build_parameter_constraint_fnsR Documentation

Build type parameter constraints

Description

Provided a list of type parameters, build functions which can be applied over runtime observed parameter values to test for constraint satisfaction.

Usage

build_parameter_constraint_fns(exprs)

Arguments

exprs

A list of language objects representing type parameters and type parameter constraints

Details

Type constraints are returned as one of two classes of functions, constrain_all and constrain_each. Names produce constrain_all functions, which expect that all observed type parameters are identical, whereas expressions produce constrain_each functions, which expect that all combinations of observed type parameters satisfy the constraint predicate.

Value

A list with named fields constrain_all and constrain_each representing two classes of constraints. constrain_all constraints expect that all observed values have identical results. constrain each constraints expect that each observed value satisfies the constraint predicate.

Examples

build_parameter_constraint_fns(list(quote(T), quote(N), quote(N > 3)))


dgkf/typewriter documentation built on March 17, 2022, 5:16 p.m.