[sammy] eta-expansion, overloading, existentials

Review by @retronym, please.

While playing with Java 8 Streams from the repl,
I realized we weren't eta-expanding,
nor resolving overloading properly for SAMs.

Also, the way Java uses wildcards to represent use-site variance
stresses type inference (since it results in existentials).

Introduce `wildcardExtrapolation` to simplify the resulting types
(without losing precision): `wildcardExtrapolation(tp) =:= tp`.

For example, the `MethodType` given by `def bla(x: (_ >: String)): (_ <: Int)`
is both a subtype and a supertype of `def bla(x: String): Int`.

Translating http://winterbe.com/posts/2014/07/31/java8-stream-tutorial-examples/ into Scala:

```
scala> import java.util.Arrays
scala> import java.util.stream.Stream
scala> import java.util.stream.IntStream
scala> val myList = Arrays.asList("a1", "a2", "b1", "c2", "c1")
myList: java.util.List[String] = [a1, a2, b1, c2, c1]

scala> myList.stream.filter(_.startsWith("c")).map(_.toUpperCase).sorted.forEach(println)
C1
C2

scala> myList.stream.filter(_.startsWith("c")).map(_.toUpperCase).sorted
res8: java.util.stream.Stream[?0] = java.util.stream.SortedOps$OfRef@133e7789

scala> Arrays.asList("a1", "a2", "a3").stream.findFirst.ifPresent(println)
a1

scala> Stream.of("a1", "a2", "a3").findFirst.ifPresent(println)
a1

scala> IntStream.range(1, 4).forEach(println)
<console>:37: error: object creation impossible, since method accept in trait IntConsumer of type (x$1: Int)Unit is not defined
(Note that Int does not match Any: class Int in package scala is a subclass of class Any in package scala, but method parameter types must match exactly.)
              IntStream.range(1, 4).forEach(println)
                                            ^

scala> IntStream.range(1, 4).forEach(println(_: Int)) // TODO: can we avoid this annotation?
1
2
3

scala> Arrays.stream(Array(1, 2, 3)).map(n => 2 * n + 1).average.ifPresent(println(_: Double))
5.0

scala> Stream.of("a1", "a2", "a3").map(_.substring(1)).mapToInt(_.parseInt).max.ifPresent(println(_: Int)) // whoops!
ReplGlobal.abort: Unknown type: <error>, <error> [class scala.reflect.internal.Types$ErrorType$, class scala.reflect.internal.Types$ErrorType$] TypeRef? false
error: Unknown type: <error>, <error> [class scala.reflect.internal.Types$ErrorType$, class scala.reflect.internal.Types$ErrorType$] TypeRef? false
scala.reflect.internal.FatalError: Unknown type: <error>, <error> [class scala.reflect.internal.Types$ErrorType$, class scala.reflect.internal.Types$ErrorType$] TypeRef? false
	at scala.reflect.internal.Reporting$class.abort(Reporting.scala:59)

scala> IntStream.range(1, 4).mapToObj(i => "a" + i).forEach(println)
a1
a2
a3

```
No, that wouldn't preserve type equivalence. The reason `def bla(x: (_ >: A)): (_ <: B)` and `def bla(x: A): B` are equivalent is that the existentials are redundant: they encode the variance position of the type of the argument and the result. 

Consider the corresponding function type as a whole: when you request a value of `String => Int`, you're happy to get any `T => Int`, as long as it's for some `T >: String` (because you intend to pass it a `String`, but it will accept any super type of `String`). When you request a `_ >: String => Int`, you're happy to receive a `String => Int` (because your existential conundrum has been resolved). Now, replace 'requesting' by 'assigning type' and 'happiness' by 'subtyping', and I rest my case.

More formally, I have to appeal to the interpretation of variant type parameters in terms of bounded abstract type members (see one-but-last page of http://lampwww.epfl.ch/~odersky/papers/ScalableComponent.pdf):

```
class C
trait X {type T}

// contra: trait X[-A] == X{ type T >: A}
typeOf[X{ type T >: C }] <:< typeOf[X{ type T >: C }] // true      typeOf[X[C]] <:< typeOf[X[_ >: C]]
typeOf[X{ type T >: C }] <:< typeOf[X{ type T >: C }] // true      typeOf[X[_ >: C]] <:< typeOf[X[C]]

// cov: trait X[+A] == X{ type T <: A}
typeOf[X{ type T <: C }] <:< typeOf[X{ type T >: C }] // false     typeOf[X[C]] <:< typeOf[X[_ >: C]]
typeOf[X{ type T >: C }] <:< typeOf[X{ type T <: C }] // false     typeOf[X[_ >: C]] <:< typeOf[X[C]]

// inv: trait X[A] == X{ type T = A }, or X{ type T = >: A <: A }
typeOf[X{ type T >: C <: C }] <:< typeOf[X{ type T >: C }] // true  typeOf[X[C]] <:< typeOf[X[_ >: C]]
typeOf[X{ type T >: C }] <:< typeOf[X{ type T >: C <: C }] // false typeOf[X[_ >: C]] <:< typeOf[X[C]]
```