otini is a user on functional.cafe. You can follow them or interact with them if you have an account anywhere in the fediverse. If you don't, you can sign up here.
otini @otini

The possibility to write

let [a; b] = expr

in is cool, but it triggers a “non exhaustive pattern-matching” warning. Which doesn't really make sense since you can only match on one pattern in a “let”.

· Web · 0 · 0

@otini you can try-catch that expression for Match_failure, but I don't think it suppresses the warning.

@orbifx No, indeed. Someone on Stack Overflow recommends adding [@warning "-8"] to the binding, but 1. it's horrible and 2. I can't seem to make it work.

@otini The compiler cannot guess the result of the evaluation of expr.
And fortunately there is no cycling in value assignation like in R.

@otini you can use GADT to prove than the received list has a length of 2 elements.