#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.
Sometimes the types aren't opaque for the client. In this case, the only client was a recursive call, and I wanted to be sure I wasn't getting the order of arguments subtly wrong.
-
-
You can create/use new opaque types at any point, no?
-
In this case, they must NOT be opaque, just distinct. I use an && between those two booleans. Don't make me reinvent that with pattern-matching. The labels are lightweight just-in-time constructors for distinct types, also deconstructed just-in-time. Just what the doctor ordered.
- 1 more reply
New conversation -
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!