You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Storage with type t = private string example explains how a private type exposes its representation for coercion while preventing callers from constructing values directly. Additional guidance about the private {} optimization mentioned later in this thread can be tracked as a separate documentation improvement.
Activity
[-]`private` keyword in `module type` [/-][+]Document `private` keyword in `module type` [/+]fhammerschmidt commentedon May 9, 2025
There is also this idiom:
Which can be used instead of an abstract type in order for the compiler to not unnecessarily add
Primitive_option.somecalls for optional props.Explanation: https://github.com/rescript-lang/rescript/pull/7450/files#r2081532393
fhammerschmidt commentedon Nov 3, 2026
Closing as covered by Refining Module Types with Constraints.
The
Storage with type t = private stringexample explains how a private type exposes its representation for coercion while preventing callers from constructing values directly. Additional guidance about theprivate {}optimization mentioned later in this thread can be tracked as a separate documentation improvement.