grapes-.-grapes: Compose Functions

Description Usage Arguments Value Examples

Description

Combine two functions into a single function so that the rhs is called on the arguments first, then the lhs.

Usage

1
lhs %.% rhs

Arguments

lhs

function to be called second

rhs

function to be called first

Value

a composed function

Examples

1
2
3
4
5
6
7
8
9
sq_log <- round %.% sqrt %.% log

Match(
  10:20,
  i %fn% (sq_log(i) > 2) ->
    "big",
  . ->
    "small"
)

matchr documentation built on Sept. 9, 2021, 5:07 p.m.