Here's a version of the Perl 6 code that's almost as terse as average Haskell code:
my $cmp = sub ($x) { state $prv; $x ne $prv ?? $prv = $x !! return; }
In reply to Re^4: 99 Problems in Perl6
by chromatic
in thread 99 Problems in Perl6
by Ovid
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |