concept type inference in category functional programming

appears as: type inference
Functional Programming in Scala

This is an excerpt from Manning's book Functional Programming in Scala.

These concerns about variance aren’t very important for the present discussion and are more of an artifact of how Scala encodes data constructors via subtyping, so don’t worry if this is not completely clear right now. It’s certainly possible to write code without using variance annotations at all, and function signatures are sometimes simpler (whereas type inference often gets worse). We’ll use variance annotations throughout this book where it’s convenient to do so, but you should feel free to experiment with both approaches.

The syntax for calling this version of dropWhile looks like dropWhile(xs)(f). That is, dropWhile(xs) is returning a function, which we then call with the argument f (in other words, dropWhile is curried[7]). The main reason for grouping the arguments this way is to assist with type inference. We can now use dropWhile without annotations: