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

Optional field in a record best practice

$
0
0

I think it really boils down to

Is it ok if I forget to instantiate b ?

If it’s ok and if you don’t need to explicitly give a value to b most of the time, then you can make it an optional field, otherwise make it a mandatory field of type option.


Viewing all articles
Browse latest Browse all 2592

Trending Articles