Advertisement
Guest User

Untitled

a guest
Jul 22nd, 2016
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Scala 0.45 KB | None | 0 0
  1. private def daysToTuple(days: Seq[Byte]) : (Boolean, Boolean, Boolean, Boolean, Boolean, Boolean, Boolean) =
  2.     days.foldLeft((false, false, false, false, false, false, false)){
  3.       case (t, 1) => t.copy(_1 = true)
  4.       case (t, 2) => t.copy(_2 = true)
  5.       case (t, 3) => t.copy(_3 = true)
  6.       case (t, 4) => t.copy(_4 = true)
  7.       case (t, 5) => t.copy(_5 = true)
  8.       case (t, 6) => t.copy(_6 = true)
  9.       case (t, 7) => t.copy(_7 = true)
  10.   }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement