Skip to content

typeof(::ComposedOptic) #16

Closed
Closed
@cscherrer

Description

hi, I'm starting to think Accessors can be a big role in Soss, not just as a library, but also in the generated code I use for sampling. The idea would be to have a collection of optics for each model, and compose these to descend into submodels.

To make this work, I need to have type-level representation of PropertyLens and ComposedOptic. A quick test gives

julia> typeof(@optic _.a.b)
Base.var"#62#63"{Accessors.PropertyLens{:b},Accessors.PropertyLens{:a}}

I had thought maybe I can get ::ComposedOptic more directly, but

julia> Accessors.ComposedOptic(Accessors.PropertyLens{:b}(),Accessors.PropertyLens{:a}())
(@optic _.b)  (@optic _.a)

julia> typeof(ans)
Base.var"#62#63"{Accessors.PropertyLens{:b},Accessors.PropertyLens{:a}}

Working in terms of Base.var"#62#63" for generated code seems very error-prone. Is there a better way to do this?

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions