Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use JuliaFunctional/CompositionsBase.jl? #139

Open
tkf opened this issue May 30, 2020 · 4 comments
Open

Use JuliaFunctional/CompositionsBase.jl? #139

tkf opened this issue May 30, 2020 · 4 comments

Comments

@tkf
Copy link
Collaborator

tkf commented May 30, 2020

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?

@jw3126
Copy link
Owner

jw3126 commented May 30, 2020

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?

@tkf
Copy link
Collaborator Author

tkf commented May 30, 2020

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.)

@jw3126
Copy link
Owner

jw3126 commented May 30, 2020

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.

@tkf
Copy link
Collaborator Author

tkf commented May 30, 2020

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.

@tkf tkf mentioned this issue May 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants