-
-
Notifications
You must be signed in to change notification settings - Fork 117
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
Backport ComposedFunction #720
Conversation
Would we want to add the constructors, too? It's a bit tricky, but something along these lines would work: @eval ComposedFunction{F,G}(f,g) where {F,G} = $(Expr(:new, :(ComposedFunction{F,G}), :f, :g))
parentmodule(typeof(h)).eval(:($(nameof(typeof(h)))(f::F, g::G) where {F,G} = $(nameof(typeof(h))){F,G}(f,g))) |
Co-authored-by: Martin Holters <martin.holters@hsu-hh.de>
@@ -607,6 +607,37 @@ if VERSION < v"1.5.0-DEV.438" # 0a43c0f1d21ce9c647c49111d93927369cd20f85 | |||
Base.startswith(s) = Base.Fix2(startswith, s) | |||
end | |||
|
|||
# https://github.com/JuliaLang/julia/pull/37517 | |||
if VERSION < v"1.6.0-DEV.1037" | |||
export ComposedFunction |
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.
I added export since Base
now exports ComposedFunction
: JuliaLang/julia#37517 (comment)
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.
LGTM
I suggest adding
Compat.ComposedFunction
when/if JuliaLang/julia#37517 is merged. This way, individual packages like DataFrames.jl don't have to implement the same hack.