Quantcast
Channel: ReScript Forum - Latest posts
Viewing all articles
Browse latest Browse all 1946

How can I implement Order from Effect-ts

$
0
0

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


Viewing all articles
Browse latest Browse all 1946

Trending Articles