交集
scala> Set(1,2,3) & Set(2,4)
res1: scala.collection.immutable.Set[Int] = Set(2)
并集
scala> Set(1,2,3) | Set(2,4)
res2: scala.collection.immutable.Set[Int] = Set(1, 2, 3, 4)
差集
scala> Set(1,2,3) &~ Set(2,4)
res3: scala.collection.immutable.Set[Int] = Set(1, 3)