You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, the compare function for Array.sort/Array.sortInPlace is typed as
('a, 'a) =>int
I do realize that this is also the signature used in OCaml's compare functions, but I wonder if the return type shouldn't be float instead for the ReScript/JS world. Looking at the MDN documentation for Array.sort, there is no need for the return type to be an integer, it is just about > 0, < 0 or === 0.
Using float instead of int would be more generic and allow us e.g. to use (a, b) => a -. b as a compare function for floats.