Skip to content

Instantly share code, notes, and snippets.

@chris-martin
Last active August 29, 2015 13:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chris-martin/8857532 to your computer and use it in GitHub Desktop.
Save chris-martin/8857532 to your computer and use it in GitHub Desktop.
scala> val a = List(Vector(1), List(1))
a: List[scala.collection.immutable.Seq[Int] with scala.collection.AbstractSeq[Int]{def companion: scala.coll
ection.generic.GenericCompanion[scala.collection.immutable.Seq with scala.collection.AbstractSeq{def dropRig
ht(n: Int): scala.collection.immutable.Seq[Any] with scala.collection.AbstractSeq[Any]; def takeRight(n: Int
): scala.collection.immutable.Seq[Any] with scala.collection.AbstractSeq[Any]; def drop(n: Int): scala.colle
ction.immutable.Seq[Any] with scala.collection.AbstractSeq[Any]; def take(n: Int): scala.collection.immutabl
e.Seq[Any] with scala.collection.AbstractSeq[Any]; def slice(from: Int,until: Int): scala.collection.immutab
le.Seq[Any] with scala.collection.AbstractSeq[Any]}]; def dropRight(n: Int): scala.collection.immutable.Seq[
Int] with scala.collection.AbstractSeq[In...
scala> val b: List[Seq[Int]] = a
b: List[Seq[Int]] = List(Vector(1), List(1))
scala> List(Vector(1), List(1))(1).contains(1)
res0: Boolean = true
scala> a.flatten
res1: List[Int] = List(1, 1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment