akheron / optics-ts

Type-safe, ergonomic, polymorphic optics for TypeScript
MIT License
769 stars 9 forks source link

"Type instantiation possibly infinite" when using .elems() #401

Open motherthestate opened 4 months ago

motherthestate commented 4 months ago

Replicated a simplified version here: https://codesandbox.io/p/sandbox/eager-smoke-sq7wkw

Typescript struggles "Type instantiation is excessively deep and possibly infinite" after only a few lens filters. What is the best way to maybe "flatten" a lens type?

jannesiera commented 2 months ago

I was trying out this project for a specific problem we have updating a deeply nested structure in a production system. However, I quickly ran into this same issue.

Since there hasn't been a response to this we won't be able to use this library.