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

Thunks syntax/custom operator #40

Open
jdesiloniz opened this issue Oct 6, 2015 · 1 comment
Open

Thunks syntax/custom operator #40

jdesiloniz opened this issue Oct 6, 2015 · 1 comment

Comments

@jdesiloniz
Copy link

In Scala, thunks are represented by the : => syntax, encapsulating a function that takes no parameters and return a value; to achieve lazy input parameters in functions. It would be nice to use custom operators to create thunks easily, so we can have parameters by name in Swift too.

@jdesiloniz
Copy link
Author

To add later:

prefix operator => {}

prefix func =>(op: T) -> (() -> T) {
return { () -> T in return op }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant