Sub::Curry

Sub::Curry is a Perl module to create curried subroutines.
Download

Sub::Curry Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Price:
  • FREE
  • Publisher Name:
  • Johan Lodin
  • Publisher web site:
  • http://search.cpan.org/~lodin/Text-Outdent-0.01/lib/Text/Outdent.pm

Sub::Curry Tags


Sub::Curry Description

Sub::Curry is a Perl module to create curried subroutines. Sub::Curry is a Perl module to create curried subroutines.SYNOPSIS use Sub::Curry; use Sub::Curry qw/ :CONST curry /; # Import spice constants # and the &curry function. #my $f1 = Sub::Curry::->new(&foo, 1, 2); # Same as below. my $f1 = curry(&foo, 1, 2); my $f2 = $cb1->new(3, 4); my $f3 = curry(&foo, 1, HOLE, 3); my $f4 = $f3->new(2, 4); $f1->('a'); # foo(1, 2, 'a'); $f2->('a'); # foo(1, 2, 3, 4, 'a'); $f3->('a'); # foo(1, 'a', 3); $f4->('a'); # foo(1, 2, 3, 4, 'a'); $f4->call('a'); # Same as $cb4->('a');Sub::Curry is a module that provides the currying technique known from functional languages. This module, unlike many other modules that borrow techniques from functional languages, doesn't try to make Perl functional. Instead it tries to make currying Perlish.This module aims to be a base for other modules that use/provide currying techniques.This module supports a unique set of special spices (argument features). It doesn't just support holes, but also introduces antiholes, blackholes, whiteholes, and antispices. All these extra special spices effect how the spice is applied to the subroutine. They make functions such as &rcurry superfluous. See "Currying" and Sub::Curry::Cookbook.An oft-missed feature is argument aliasing. This module preserves the aliasing.Sub::Curry does explicit currying. For more automatic ways to use currying, look in the Sub::Curry::* namespace.When version hits 1.00 the interface will be stable. Requirements: · Perl


Sub::Curry Related Software