I meant that the full example seems to run fine in the playground
module PairComparator =
Belt.Id.MakeComparable({
type t = (int, int);
let cmp = ((a0, a1), (b0, b1)) =>
switch (Pervasives.compare(a0, b0)) {
| 0 => Pervasives.compare(a1, b1)
| c => c
};
});
let myMap = Belt.Map.make(~id=(module PairComparator));
let myMap2 = Belt.Map.set(myMap, (1, 2), "myValue");
Where the only difference is the last line!
(And sorry, I misspoke then, the usage of the Map makes the compiler infer the (int, int)
where the comparator definition from before seems not to be enough!)