@saulpalv exactly I want something like Partial
not possible ?
and are there any good resources/tips for learning about the type-level stuff in rescript?
The type system in ReScript requires you to think about things up front since you can’t modify the types later.
If you have a type with an optional field of name and a type where name is required, they aren’t really the same type.
You can use type spreading to share common keys across types.
type person = {
name: string,
age: int,
}
type user = {
...person,
address?: string // we might not have an address for all users
}
type billing = {
...person,
address: string // we have to have an address for shipping
}