Skip to contents

Evaluate a decorated function

Usage

bind_loudly(.l, .f, ...)

Arguments

.l

A loud value (a list of two elements)

.f

A loud function to apply to the returning value of .l

...

Further parameters to pass to .f

Value

A list with elements .f(.l$result) and concatenated logs.

Examples

loud_sqrt <- loudly(sqrt)
loud_exp <- loudly(exp)
3 |> loud_sqrt() |> bind_loudly(loud_exp)
#> $result
#> [1] 5.652234
#> 
#> $log
#> [1] "Log start..."                                                                    
#> [2] "✔ sqrt(3) started at 2022-03-16 21:11:53 and ended at 2022-03-16 21:11:53"       
#> [3] "✔ exp(.l$result) started at 2022-03-16 21:11:53 and ended at 2022-03-16 21:11:53"
#>