Changing to scala
Improving verbosity by making constraint a macro