I also have a variable that hold an Array of those points.
I would like to create a Set from that array, but it seems I need to supply ~id value to Set.fromArray.
The example in the docs is:
let s0 = Belt.Set.fromArray([1, 3, 2, 4], ~id=module(IntCmp))
I tried to use that ~id and expected to get an error. The error I got is not exactly what I expected:
he module or file IntCmp can't be found.
- If it's a third-party dependency:
- Did you list it in bsconfig.json?
- Did you run `bsb` instead of `bsb -make-world`
(latter builds third-parties)?
- Did you include the file's directory in bsconfig.json?
Is there more examples on how to create ~id for custom types?
Note that Pervasives is open by default, so writing out Pervasives.compare is equivalent to just writing compare (unless you shadowed compare with your own function). You actually use Pervasives a lot without necessarily realizing it.