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

Creating Optional Fields out of strict record

$
0
0

How can I convert a record with strict fields to optional fields?
For example, if i have a record like

type t = { name : string, age : int}

i want some wrapper type like

type optional_t = MakeOptional(t)
-- same as:
-- type optional_t = { name ?: string, age ?: int} 

Viewing all articles
Browse latest Browse all 1770

Trending Articles