4 ms·
You make it sound like lenses are a sort of a crutch, but in my opionion they are not. The idea of having a first-class, composable way to “focus” on a part of
by zoul 8y ago
You make it sound like lenses are a sort of a crutch, but in my opionion they are not. The idea of having a first-class, composable way to “focus” on a part of a larger structure makes a lot of sense. And can be very pretty, too – see Swift’s key paths. That kind of type safety and simplicity is very appealing to me. As for efficiency, copying stuff usually means improved thread safety, so that’s win for me. Also, copy on write makes things often much more efficient in practice.