Scala 3, Programming Scala.
val xssSome = List(List(0), List(1,0), List(2,1,0), List(3,2,1,0)) val xssNone = List(List(0), Nil, List(2,1,0), List(3,2,1,0)) assert(firstColumn(xssSome) == Some(List(0,1,2,3))) assert(firstColumn(xssNone) == None) To really appreciate this example, try writing the same method without the