String properties not supported
julia> @optic _."abc"
ERROR: TypeError: in Type, in parameter, expected Type, got a value of type String
This is because PropertyLens is defined to hold the property name as a type parameter, and Strings cannot be type params. Not sure what we can do, but maybe someone has ideas on how to fix it?
We could fix it by storing it as a symbol using StringPropertyLens. Do we want and need that?
I noticed this missing in terms of actual underlying functionality, not syntax: that is, I haven't needed @o _."abc" syntax yet, but wanted a way to refer to arbitrary properties. Their "names" in Julia can be symbols or int (these are supported by PropertyLens), but also strings (actually occur in the ecosystem) or arbitrary objects (haven't seen these in practice).
We could also have
struct DynamicPropertyLens{T}
propertyname::T
end