NAME
FP::Ops -- function wrappers around Perl ops
SYNOPSIS
use FP::Ops 'add';
our $fibs; $fibs=
cons 1, cons 1, lazy { stream_zip_with \&add, Keep($fibs), rest $fibs };
DESCRIPTION
There's no way to take a code reference to Perl operators, hence a subroutine wrapper is necessary to pass them as arguments. This module provides them.
Also similarly, `the_method("foo", @args)` returns a function that does a "foo" method call on its argument, passing @args and then whatever additional arguments the function receives.
`cut_method` is a variant of the_method which takes the object as the first argument: `cut_method($obj,"foo",@args)` returns a function that does a "foo" method call on $obj, passing @args and then whatever additional arguments the function receives.
Also, `binary_operator("foo")` returns a function that uses "foo" as operator between 2 arguments. `unary_operator("foo")` returns a function that uses "foo" as operator before its single argument. CAREFUL: make sure the given strings are secured, as there is no safety check!