Skip to content

Use JuliaFunctional/CompositionsBase.jl? #139

Open

Description

@tkf

I created https://github.com/JuliaFunctional/CompositionsBase.jl so that packages dealing with morphisms can share symbols like ⨟, compose, and opcompose (an ASCII alias of ⨟). As we discussed in JuliaFolds/Transducers.jl#67, my motivation is to use this from Transducers.jl. Do you want to use it from Setfield?

I also invited you to the organization so that you can tweak CompositionsBase.jl directly if you need to. Do you want to co-maintain it?

Activity

  1. jw3126 commented on May 30, 2020

    @jw3126
    Owner

    Thanks for the invite, I am happy to co-maintain it. What do you mean by

    Do you want to use it from Setfield?

    As I understand, the operations in CompositionBase.jl are all derived from ∘? So they automatically work on lenses without any extra code needed in Setfield.jl?

  2. tkf commented on May 30, 2020

    @tkf
    CollaboratorAuthor

    Ah, I forgot that Setfield.jl didn't export compose.

    So, you are right, there is no need for Setfield.jl to import CompositionsBase.jl (unless you want to re-export compose etc.)

  3. jw3126 commented on May 30, 2020

    @jw3126
    Owner

    There is one subtle point. Setfield.compose() is a lense, while CompositionBase.compose() throws an error. Its a bit awkward. We could rename Setfield.compose into e.g. lenscompose and reexport CompositionBase if you like.

  4. tkf commented on May 30, 2020

    @tkf
    CollaboratorAuthor

    Setfield.compose() is a lense

    Ah, good point. Well, if nobody asked to export this function, I think it's OK to keep it like this. Though probably a super careful approach is to use lenscompose so that it is possible to re-export CompositionsBase.compose from the top-level namespace at some point.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions