News for hackers. Stuff that matters.
Re:Why We Use OCaml by rlander on Monday November 16, 2015 @11:05AM (#10575153)
You can use, for example, elaborate if-else constructs that firstly try to determine type of the value, then check for values.

That's nowhere near pattern matching. Two concepts make pattern matching vastly superior to if-else constructs:

- Non-exhaustive checks by the compiler.

- Destructuring

Re:Why We Use OCaml by dozzie on Monday November 16, 2015 @04:09PM (#10577177)
Oh, look, non-exhaustive checks are exactly as with if-else. And no, `match .. with' cannot be calculated in compilation time typically. Poor argument.

It's being a combination of destructuring, branch selection and variable assignment that makes pattern matching superior.