Hacker News new | ask | show | jobs
by masklinn 1221 days ago
FWIW if you’re just “unpacking” a structure `match` / `case` is unnecessary syntactic overhead, you can just use a regular let:

    // rust
    let Item { name, .. } = item;

    -- haskell
    let Item { name } = item in …
(Note: the haskell version requires NamedFieldPuns, or RecordWildCards for something like Rust’s version)