I wonder if it is possible to implement smart constructor like in F#
I read some thread on this forum about private constructor, and this compile:
type someType = private SomeType(string)
At first, i thought that i could do the same thing i do in F#, but i saw that when you declare type this way, you cannot create them after, unlike F# (when you declare a module with the same name that the variant type).
I would like to restrict the use of constructor variant in order to prevent invalid state in my domain.
Like in F#, i would like to only be able to use a factory method to create such types.
Do you have advice about a way to do this in ReScript ??