debian man page for data::util::curry

Query: data::util::curry

OS: debian

Section: 3pm

Format: Original Unix Latex Style Formatted with HTML and a Horizontal Scroll Bar

Data::Util::Curry(3pm)					User Contributed Perl Documentation				    Data::Util::Curry(3pm)

NAME
Data::Util::Curry - Curries functions and methods
SYNOPSIS
use feature 'say'; use Data::Util qw(curry); sub sum{ my $total = 0; for my $x(@_){ $total += $x; } return $total; } # placeholder "" indicates a subscript of the arguments say curry(&add, , 42)->(10); # 52 # placeholder "*_" indicates all the arguments say curry(&add, *_)->(1 .. 10); # 55 # two subscripts and the rest of the arguments say curry(&add, *_, 1, )->(1 .. 5); # 3 + 4 + 5 + 1 + 2
DESCRIPTION
(todo)
EXAMPLES
Currying Functions curry(&f, , 2)->(1); # f(1, 2) curry(&f, 3, )->(4); # f(3, 4) curry(&f, *_)->(5, 6); # f(5, 6) curry(&f, , 1, *_)->(1, 2, 3, 4); # f(1, 2, 3, 4) curry(&f, *_, , 1)->(1, 2, 3, 4); # f(3, 4, 1, 2) Currying Methods curry($obj, 'something', *_)->(1, 2); # $obj->something(1, 2) curry($obj, 'something', foo => , bar => 1)->(1, 2); # $obj->something(foo => 1, bar => 2) curry(, 'something', 1)->($obj, 42); # $obj->something(42) curry($obj, , *_)->('something', 1, 2); # $obj->something(1, 2) Argument Semantics sub incr{ $_[0]++ } my $i = 0; curry(&incr, )->($i); # $i++ curry(&incr, *_)->($i); # $i++ curry(&incr, $i)->(); # $i++
SEE ALSO
Data::Util. perl v5.14.2 2011-10-20 Data::Util::Curry(3pm)
Related Man Pages
moose::autobox::code(3) - mojave
xml::grove::sub(3) - redhat
data::amf(3pm) - debian
data::stag::hashdb(3pm) - debian
data::stream::bulk::util(3pm) - debian
Similar Topics in the Unix Linux Community
awk command not woking
How to add the contents of a file?
Linking Linux Driver written in C with ASM module
Printer is winning the battle! (for now)
SunONE (webserver7) obj.conf