Closed jdegoes closed 4 years ago
It was suggested to me we can simply use a Lens
for List[A]
. Then the user can (via imap
) support any other collection type which is isomorphic to a lens. And we can have different helpers for all of Scala's standard collections, as well as helpers for Scalaz data structures.
We have a schema for a list. But we can generalize this and use use a
Traversal
optic like the product (lens) and sum (prism) cases.Something like this:
I think every optic type will have its own term in the
Schema
sum type to give us the greatest chances for powerful composition.Note: this is not quite right because we would like the ability to not only just modify elements and retrieve them, but also set them.