#OCaml tip: when you function takes several arguments of the same type (e.g. two booleans), or even generic types (e.g. 'a and 'b) that in practice would be non-disjoint in callers, use labeled arguments. This way, you'll avoid bugs due to inadvertently mixing up arguments.
-
-
Replying to @Ngnghm
Same in Scala. But there's a better solution. Don't use Boolean args.
2 replies 0 retweets 0 likes
Replying to @vpatryshev
Also, the advice of making non commutative variables of the same type applies to all types, not just the booleans I had to distinguish in the case at hand. Exception when the function is so well known or often used, with few enough arguments, that position is unambiguous.
8:37 AM - 21 Aug 2018
0 replies
0 retweets
1 like
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.
Read my blog!