Files
devops/perl/Examples/Chap7/combine2-shorter
2025-09-17 16:08:16 +08:00

19 lines
254 B
Plaintext

###
### 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)) });
};
}