scala/ScalaBook/chapter-03/exist.scala
val A:List[_] = List(1,"Scala",1.0,true,List(1,2,3))
println(A)
val B:List[α forSome {type α}] = List(1,"Scala",1.0,false)
println(B)
//val D:List[List[α forSome { type α <: Long }]] = List(List(1,2,3),List(1.0,2.0))
//println(D)
type β = α forSome { type α }
type γ = β => β
def id(x: β): β = x
def f(A: γ ) = (A(3),A('x'))
println(id(3))
println(id("hello"))
println(f(id))
// data Expr a = Val a | forall b . Apply (Expr (b -> a)) (Expr b)
trait Expr[α]
case class Val[α](x: α) extends Expr[α]
case class Apply[α,β](a: (α=>β), b:α) extends Expr[α forSome { type α }]
def id2(x:β) = 4
val y = new Apply(id2,5)
println(y.a(y.b))