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

It's the same as case classes and pattern matching in Scala [1]. Or case expression and pattern matching in Haskell [2]. Or in OCaml [3]. Or in Rust [4].

[1] http://docs.scala-lang.org/tutorials/tour/case-classes.html

[2] http://learnyouahaskell.com/syntax-in-functions#pattern-matc... "case expressions" at the end of the page.

[3] http://ocaml.org/learn/tutorials/data_types_and_matching.htm...

[4] http://static.rust-lang.org/doc/master/tutorial.html#control...



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

Search: