Unofficial Hacker News companion — get notified on comment replies, and more.

Roc version 0.1.0, eight years in the making (opens external site)

484 points by DrDeadCrash 1 day ago | rtfeldman.com | 134 comments on HN | Vote on HN (opens Hacker News) |

View full thread · View on Hacker News

Comment thread (1)

  1. Raku can do that, too:

    multi sub compress([]) { () }

    multi sub compress([$x]) { $x }

    multi sub compress([$x, @ys [$y, *]]) {

        $x === $y ?? compress(@ys) !! ($x, |compress(@ys))  
    
    }