first commit
This commit is contained in:
18
perl/Examples/Chap7/combine2-shorter
Normal file
18
perl/Examples/Chap7/combine2-shorter
Normal file
@@ -0,0 +1,18 @@
|
||||
|
||||
|
||||
###
|
||||
### combine2.1
|
||||
###
|
||||
|
||||
## Chapter 7 section 1
|
||||
|
||||
sub combine2 {
|
||||
my $op = shift;
|
||||
my $r;
|
||||
$r = sub {
|
||||
my ($s, $t) = @_;
|
||||
return unless $s && $t;
|
||||
node($op->(head($s), head($t)),
|
||||
promise { $r->(tail($s), tail($t)) });
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user