7 ms·
Does the proposal have any effect on lens usage? EDIT: I mean, lenses and RecordDotSyntax both provide a way to access nested fields in records, so the new syn
by imdoor 6y ago
Does the proposal have any effect on lens usage?
EDIT: I mean, lenses and RecordDotSyntax both provide a way to access nested fields in records, so the new syntax would take away some of the reasons to use lenses. But are there any other relations among the two, or do lenses and RecordDotSyntax just provide two different solutions to the same problem?
- kqr 6y agoLenses (or, rather, optics) are still far more powerful than plain record field getters. Optics allow - Mutation of nested records, - Iteration of collections, - Folding of collections, - Viewing discriminated cases that may or may not exist, - Building a structure around a value, and so on and so forth.
- imdoor 6y agoYeah, there are still a lot of reasons to use lenses. But to rephrase - i was wondering if lenses and the proposal somehow "interact". Actually, I just found some of what i was after in this comment [1]. [1] https://github.com/ghc-proposals/ghc-proposals/pull/282#issuecomment-546159561 https://github.com/ghc-proposals/ghc-proposals/pull/282#issu...
- kreetx 6y agoBut this has nested mutation, no?