File: curry.t

package info (click to toggle)
libautobox-core-perl 1.2-1
  • links: PTS
  • area: main
  • in suites: squeeze
  • size: 328 kB
  • ctags: 161
  • sloc: perl: 567; makefile: 2
file content (14 lines) | stat: -rw-r--r-- 231 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
use Test::More qw(no_plan);
use strict;
use warnings;

use autobox::Core;


my $times = sub { $_[0] * $_[1] };

my $times_two = $times->curry(2);
my $times_four = $times->curry(4);

is $times_two->(5), 10;
is $times_four->(5), 20;