Open peterpme opened 3 years ago
I was trying to understand how to use Belt.set and the example I see is.
Even for somebody whose used a bit of Reason, this takes a bit to grok 😅
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 mySet = Belt.Set.make(~id=module(PairComparator)) let mySet2 = Belt.Set.add(mySet, (1, 2))
In this specific example, I don't have an alternative but just wanted to bring this to attention. Thanks!
I was trying to understand how to use Belt.set and the example I see is.
Even for somebody whose used a bit of Reason, this takes a bit to grok 😅
In this specific example, I don't have an alternative but just wanted to bring this to attention. Thanks!