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

Enable function composition for . fusion operator #21875

Open
davidanthoff opened this issue May 14, 2017 · 4 comments
Open

Enable function composition for . fusion operator #21875

davidanthoff opened this issue May 14, 2017 · 4 comments

Comments

@davidanthoff
Copy link
Contributor

This would be similar to the way ! and work right now.

For example, map(f., x) would be equivalent to map(i -> f.(i), x).

This would make map work pretty seamlessly with the whole call-site lifting operator as it is implemented right now, i.e. if x is a Array{Nullable{T},N} this would be a natural way to map the lifted version of a function over that array.

@yurivish
Copy link
Contributor

Would f..(x) mean (i -> f.(i)).(x)?

@davidanthoff
Copy link
Contributor Author

Yes. I'm realizing now that this issue here is essentially subsuming #20502.

@JeffBezanson
Copy link
Sponsor Member

Some languages use .a as short for x -> x.a, which is kind of nice. Could be compatible with this, but just something else to think about around dots.

@davidanthoff
Copy link
Contributor Author

Some languages use .a as short for x -> x.a, which is kind of nice. Could be compatible with this, but just something else to think about around dots.

And I would very much like that as well :) My understanding of the parser is not good enough to be able to tell whether this could be compatible, I'm afraid...

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

3 participants