In infix and prefix forms.

compose(...)

f %.% g

Arguments

...

n functions to apply in order from right to left

f, g

two functions to compose for the infix form

Examples

not_null <- `!` %.% is.null
not_null(4)
#> [1] TRUE
not_null(NULL)
#> [1] FALSE

add1 <- function(x) x + 1
compose(add1,add1)(8)
#> [1] 10