optics icon indicating copy to clipboard operation
optics copied to clipboard

Restrict over', iover', and set' to traversals

Open treeowl opened this issue 3 years ago • 1 comments

  • over', iover', set', and associated operators previously accepted setters. However, it's impossible to actually modify strictly through a setter; a traversal is needed for that. Restrict the types to require A_Traversal, and remove the associated (technically correct but deceptive) Mapping instances.

  • Document the strictness behavior of set'.

  • The internal Identity' type was non-standard and overly complicated. The Solo type, now in base, is operationally identical and simpler to deal with. Use that instead.

  • Remove some surprisingly lazy matches on Identity'/Solo.

Fixes #473

treeowl avatar Dec 28 '22 00:12 treeowl

I think it would be rather nice to add the strictly combinator I've proposed for lens, but it would probably take me a bit to learn enough about how this package works to be able to do that myself.

treeowl avatar Dec 28 '22 04:12 treeowl