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

Function composition operator? #18783

Closed
jw3126 opened this issue Oct 4, 2016 · 2 comments
Closed

Function composition operator? #18783

jw3126 opened this issue Oct 4, 2016 · 2 comments

Comments

@jw3126
Copy link
Contributor

jw3126 commented Oct 4, 2016

Would it be worthwhile to have a function composition operator in julia? I often have code which looks like

map(x -> g(f(x)), iter)

or maybe

hgf(x) = x |> f |> g |> h
map(hgf, iter)

I think it would be nice to write this as

map(g∘f, iter)
map(h∘g∘f, iter)

A basic implementation would be

∘(g,f) = x-> g(f(x))

See also #5236

@tkelman
Copy link
Contributor

tkelman commented Oct 4, 2016

#17184 and #17155

@jw3126
Copy link
Contributor Author

jw3126 commented Oct 4, 2016

Thanks, I guess there is no need to have another place for discussing this.

@jw3126 jw3126 closed this as completed Oct 4, 2016
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