Scala extends double arrow

scala, syntax, traits

Solution

This is syntactic sugar for `Function1` which is the same as this:

trait RowParser[+A] extends Function1[Row, SqlResult[A]] 

If you look further in the Anorm source you'll see that when the trait is implemented it has to define an `apply` function since it's implementing the Function1 trait.

Problem

I was looking at the Anorm source code and for the `RowParser` trait it has the declaration: ``` trait RowParser[+A] extends (Row => SqlResult[A]) { ... } ``` I was curious what type `(Row => SqlResult[A])` is? I haven't been able to find an explanation of the syntax anywhere.

Original source