I'm writing Domain Logic for one of the application using F#. I want to control access on fields defined for a type in F# so that I can implement builder pattern and control type instantiation.
Want to do something similar with do in builder pattern in C#/Java.
Kindly suggest.
e.g. let Person = { Name:string Age:number Salary:string }
So I want to make sure person should always be instantiated with Name and Age. But salary should be optional. Instantiation should happen in a builder pattern.