second-bridge
second-bridge copied to clipboard
Thunks syntax/custom operator
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.
To add later:
prefix operator => {}
prefix func =><T>(op: T) -> (() -> T) { return { () -> T in return op } }