• + 0 comments

    Thinking along the same lines here with Scala:

      println {
        val List(p, q) = stdin.getLines.take(2).toList
        (p, q).zipped flatMap (List(_, _))
      }
    

    But I still like the Haskell solution better. Comprehensions are much more intiuitive in Haskell. Comprehensions in Scala are type-homogenous, Scala 3 will hopefully take care of this. This is a topic for somewhere else though.