Pattern Matching


[Up] [Top]

Documentation for package ‘pmatch’ version 0.1.3

Help Pages

:= Define a new data type from a sequence of constructors.
assert_correctly_formed_pattern_expression Raise an error if a match expression is malformed.
bind Dummy object used for generic function dispatching.
cases Dispatches from an expression to a matching pattern
cases_expr Create an expression that tests patterns against an expression in turn
cases_expr_ Create an expression that tests patterns against an expression in turn
construction_printer Print a constructed value
copy_env Move the bound variables from one environment into another.
deparse_construction Create a string representation from a constructed object
make_args_list Construct a pair-list of arguments that can be used to create a new function
make_match_expr Create an if-statement for 'cases_expr' and 'cases_expr_' functions
process_alternatives Goes through a list of |-separated expressions and define them as constructors
process_arg Build a tibble form a list of constructor arguments.
process_arguments Construct a tibble from all the arguments of a constructor
process_constructor Create a constructor and put it in an environment.
process_constructor_constant Create a constant constructor and put it in an environment.
process_constructor_function Create a function constructor and put it in an environment.
test_pattern Test if a pattern matches an expression
test_pattern_ Test if a pattern matches an expression
test_pattern_rec Recursive comparison of expression and pattern.
transform_cases_call Recursive function for transforming a call 'cases'.
transform_cases_function Transform a function containing a 'cases' call into one that instead has if-statements.
transform_cases_function_rec Recursive function for transforming a function that uses 'cases'.
[<-.pmatch_bind Bind variables to pattern-matched expressions.