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 type syntax #30

Open
beikov opened this issue Apr 7, 2021 · 0 comments
Open

Function type syntax #30

beikov opened this issue Apr 7, 2021 · 0 comments
Labels
enhancement New feature or request

Comments

@beikov
Copy link
Member

beikov commented Apr 7, 2021

There are some use cases in the collection functions area where it would be beneficial if a user could provide some kind of user defined function for extracting values. I'm proposing to add a Function type for this purpose that has two type parameters, input and output type. Collection functions could then use that type as argument type. Syntax-wise I would allow the user to provide a custom name for the input i.e. the following: priceHistory.sum(entry -> entry.price). Not sure yet if a short-hand syntax is a good idea, but maybe we could allow priceHistory.sum(#price).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant