in reply to Re^3: 99 Problems in Perl6in thread 99 Problems in Perl6
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; } [download]