We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I find myself adding superfluous unit literals at the end of event handlers.
Compare the following two examples:
Using Scaloid's onClick:
button.onClick { dir.mkdir() // ← returns Boolean, not Unit () // ← boilerplate required to conform with Unit result type }
Compared to trivial usage of Scala's foreach:
dirs.foreach { dir ⇒ dir.mkdir() // ← returns Boolean, which is discarded }
The latter is preferable.
This is really easy to implement, as seen from foreach's definition:
def foreach[U](f: A ⇒ U): Unit
Where U clearly stands for Unit, but is actually more liberal.
Applying this to (e.g.) 'onClick', the signature would look like so:
def onClick[U](f: View ⇒ U)
The text was updated successfully, but these errors were encountered:
Good suggestion, thanks! I am working on this issue.
Sorry, something went wrong.
7a8f702
No branches or pull requests
I find myself adding superfluous unit literals at the end of event handlers.
Compare the following two examples:
Using Scaloid's onClick:
Compared to trivial usage of Scala's foreach:
The latter is preferable.
This is really easy to implement, as seen from foreach's definition:
Where U clearly stands for Unit, but is actually more liberal.
Applying this to (e.g.) 'onClick', the signature would look like so:
The text was updated successfully, but these errors were encountered: