let cmp x y = match x, y with
| A, A -> true
| A, _ | _, A -> false
| B, B -> true
| B, _ (*| _, B*) -> false
That's the style I use.
On Sat, Apr 30, 2011 at 3:43 PM,
craff73@gmail.com <craff73@gmail.com> wrote:
Hello,
You want to avoid code size quadratic in the number of constructors. Which is possible:
let cmp x y = match x, y with
A, A -> true
| A, _ | _, A -> false
| B, B -> true
| B, _ | _, B -> false
...
Cheers
Christophe
--
Envoyé de mon téléphone Android avec K-9 Mail. Excusez la brièveté.