Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Event-listener setters should have signature onClick[U](f: View ⇒ U) instead of onClick(f: View ⇒ Unit) #78
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: