Fix some bugs by being more explicit

* Surround lambdas by [ ]
* Declare an application with `app`
* Remove ambiguity in the type declaration by explicitly making it
  right associative