I did not want to write bindings, I want to write this (or something similar) in rescript.
So far I’ve got this:
type t<'a> = ('a, 'a) => Core__Ordering.t
let make = (compare: t<'a>, self, other) => self == other ? 0.0 : compare(self, other)
let str = make(String.localeCompare, ...)
let num = make((a: int, b: int) => a > b ? 1.0 : -1.0, ...)
I need help with the map
function