Updating deep records

Is there an easy way to update (in an immutable way) deep records in rescript?

Not sure if a lenses exist for ReScript, of if good typesafe lenses are possible for the language.

But I have a warning for you :stuck_out_tongue:

It is possible that the concept of a [lenses lib] is harmful to code quality in that it can help you to be lax with abstraction boundaries. A modular architecture as described here happens quite naturally in a world without [lenses], but with the concept of [lenses] there’s a feeling that “maybe modularity is for suckers… Maybe I can get away without it!”
Evan Czaplicki

Thanks @hoichi . Will look into it.

The spread operator helps, if it becomes too repetitive or the record is very deep, writing a specialized utility function can help, something like this: updateUserInDeepResource(resource, user => {...user, name: newName})