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

Proposal to add a fun currying syntax for nested function calls #14

Open
eliassjogreen opened this issue Mar 19, 2022 · 0 comments
Open
Labels
proposal A proposal to add a new feature to the language

Comments

@eliassjogreen
Copy link
Member

This is an quite old idea but it would essentially allow for a function to be called in multiple different stages before finally executing:

fn bake_a_cake(first: str)(second: i32)(third: bool): str {
  // function body goes here
}

It could then be called like:

val first: fn((second: i32)(third: bool): str) = bake_a_cake("add something")
val final: str = first(123)(false)

This would probably require an auto or automatically inferred type along with a fn type for function references.

@eliassjogreen eliassjogreen added the proposal A proposal to add a new feature to the language label Mar 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
proposal A proposal to add a new feature to the language
Projects
No open projects
Development

No branches or pull requests

1 participant