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

Consistent optional label args syntax

$
0
0

Rescript 10 introduced optional record fields

type person = {
  age: int,
  name?: string
}

that syntax was borrowed from typescript/kotlin

that makes the optional labeled argument syntax inconsistent

let drawCircle: (~color: color, ~radius: int=?) => unit

would be consistent as

let drawCircle: (~color: color, ~radius?: int) => unit

Viewing all articles
Browse latest Browse all 2592

Trending Articles