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

Module-scoped type as alias?

$
0
0

What you’re actually looking for is this:

module CmpInt: Comparable with type t = int = {
  type t = int
  let equal = (x: int, y: int) => x === y
}

Otherwise the type t is abstract and the compiler can’t know it’s actually int.


Viewing all articles
Browse latest Browse all 1835

Trending Articles