4 ms·
A nice thing about optics is that they are strongly typed enough that it's pretty hard to make them do the "wrong" thing. The type errors can be confusing (beca
by wyager 4y ago
A nice thing about optics is that they are strongly typed enough that it's pretty hard to make them do the "wrong" thing. The type errors can be confusing (because the underlying types are rich), but I've rarely/never actually been able to make incorrect optics-based code compile.
As far as legacy projects - optics are awesome for refactoring complex nested state operations like you would see in many business-centric applications.
A lot of apps are basically just complex nested operations on a big, heterogenous, in-memory data structure, and optics are the best known DSL for reading/writing/processing such structures.
- ParetoOptimal 4y ago> As far as legacy projects - optics are awesome for refactoring complex nested state operations like you would see in many business-centric applications. Motivating lenses will consist of concisely demonstrating this in a RecordDotSyntax world I think. Optics by example does a really good job, but I think we need like a hotel reservation app architected with lenses or something.