Scala Tuple Extensions

Typesafe operations on tuples.

Build Status codecov

  • prepend value "abc" +: (1, false) == ("abc", 1, false)
  • append value (1, false) :+ "abc" == (1, false, "abc")
  • concatenate (1, false) :++ ("abc", 3.14) == (1, false, "abc", 3.14); (1, false) ++: ("abc", 3.14) == (1, false, "abc", 3.14)
  • reverse (1, 2, 3).reversed == (3, 2, 1)
  • rotateRight (1, 2, 3).rotatedRight == (3, 1, 2)
  • rotateLeft (1, 2, 3).rotatedLeft == (2, 3, 1)
  • case class ToTuple case class CC(a: Int, b: String, c: Float) ToTuple(CC(1, "b", 3.14)) == (1, "b", 3.14) So this is designed as less type-confusing analog of CC.unapply(CC(1, "b", 3.14)).get
  • case class FromTuple case class CC(a: Int, b: String, c: Float) FromTuple((1, "b", 3.14)).to[CC] == CC(1, "b", 3.14)