Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

From a quick scroll, that seems to be just C-style `select` with `if` guards?

What I was referring to is things like `match x { Some(y) => ..., None => ... }`, where there is data that is available only in some variants of the type (like `y`). Without a type, even naming these variants becomes an interesting problem. (Not unsolvable, mind you. But not obvious either, and you lose some of the benefits that algebraic data types have in typed languages.)



No, it matches on the structure of data as well as embedded values. E.g. you can match on %{foo: y} vs %{bar: y}.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: