Skip to content

Consider subtyping Function #37

@andyferris

Description

@andyferris

Hi,

One thing that can help with compatibility elsewhere is to hint your lenses and so-on are functions, by directly subtyping Function.

For example the code at https://github.com/JuliaObjects/Accessors.jl/blob/master/src/optics.jl#L345 could become:

struct PropertyLens{fieldname} <: Function
end 

This came up in SplitApplyCombine, which (unfortunately) is currently using Base.Callable in a few cases (although I wish the API were factored so it were obvious which terms must be functions rather than collections), here.

CC @aplavin

Metadata

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