Last updated
Was this helpful?
Last updated
Was this helpful?
The best type to use for the parameter of a higher-order function is Callable
(implied by the &
sigil), a role common to all function-like objects. For an example of defining and calling a second-order function, see .
Convenient syntax is provided for anonymous functions, either a bare block, or a parametrized block introduced with ->
, which serves as a "lambda":