-
Notifications
You must be signed in to change notification settings - Fork 66
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
fix: make compose do what it says #1606
Conversation
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## master #1606 +/- ##
=======================================
Coverage 86.95% 86.96%
=======================================
Files 115 114 -1
Lines 29628 29642 +14
=======================================
+ Hits 25764 25778 +14
Misses 3864 3864 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So f(g)
is "f evaluated at g", if I am not mistaken the resulting polynomial satisfies the condition f(g)(x) = f(g(x))
-- so
In contrast to the older, today unusual (outside of group theory and a few other special branches) notation for function application from the right: x^f= f(x)
, which is a right action:
But I am not saying this should imply that the meaning of :left
and :right
for side
should necessarily be switched: I don't think 99% of people reading this docstring would be able to come up with my reasoning and apply it within a sensible amount of time (that includes me -- I wouldn't dare to trust this, I would just do trial and error or look into the implementation or whatever)
Just to mention another alternative: I think Mohamed used PreCompose
and PostCompose
for these instead, in the context of morphisms. Granted, to me that still doesn't make it unique, but at least it give me a simple mnemonic ("Eselsbrücke") to remember it
PreCompose(f,g)
produces a function which applies$f$ before (pre)$g$ ,
PostCompose(f,g)
produces a function which applies$f$ after (post)$g$ ,
But this is for morphisms not polynomials and series, so we have at least one mental translation step, which could again go one way or the other...
Indeed, translated to polynomials and series one could say:
compose(f,g;side=:pre)
(orside=:before
) means "f
beforeg
", as inf(g)
or one could take the literal translation of Mohamed's definition, which would give the opposite:
compose(f,g;side=:pre)
(orside=:before
) means "f
beforeg
", as ing(f)
becauseg(f(x))
appliesf
beforeg
.
All in all I see no good way to define this. Maybe we should call it :a
and :b
then, it'd be at least short ;-).
Anyway, because of this: I have no particular motivation to disagree with your dice.
@fingolfin I renamed the keyword argument as we discussed it and will merge this soon. |
- First step at resolving oscar-system/Oscar.jl#690 - Introduce a mandatory keyword `inner = :first/:second` argument for compose(f, g) and add a hint for f(g)/g(f) syntax. [breaking]
* fix: make compose do what it says - First step at resolving oscar-system/Oscar.jl#690 - Introduce a mandatory keyword `inner = :first/:second` argument for compose(f, g) and add a hint for f(g)/g(f) syntax. [breaking] * chore: bump to 0.39.0
compose(f,g)
is inconsistent oscar-system/Oscar.jl#690and add a hint for f(g)/g(f) syntax.
[breaking]
Edit: I threw a dice and decided that
compose(f, g; side = :right)
meansf(g)
,compose(g, f; side = :left)
meansg(f)
.Obviously I don't have a strong opinion.