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

Creating Optional Fields out of strict record

$
0
0

a bit verbose but I have used a pattern of making a structure type and then instantiating:

type structure<'a, 'b> = { name: 'a, age: 'b}
type t = structure<string, int>
type opt = structure<option<string>, option<int>>

Viewing all articles
Browse latest Browse all 1976

Trending Articles