JPDev@programming.dev to Programmer Humor@programming.dev · 8 months agoExam Answerprogramming.devimagemessage-square22fedilinkarrow-up17arrow-down10
arrow-up17arrow-down1imageExam Answerprogramming.devJPDev@programming.dev to Programmer Humor@programming.dev · 8 months agomessage-square22fedilink
minus-squaresilasmariner@programming.devlinkfedilinkarrow-up2·edit-28 months agoThey missed out the context code: trait DoW { def length: FiniteDuration } object Monday extends DoW { override def length = 24.hours } ... implicit def toDoW(s: String): DoW = s match { case "Monday" => Monday ... } var day: DoW = _ (Duration formatting and language identification are left as an exercise for the reader)
They missed out the context code:
trait DoW { def length: FiniteDuration } object Monday extends DoW { override def length = 24.hours } ... implicit def toDoW(s: String): DoW = s match { case "Monday" => Monday ... } var day: DoW = _
(Duration formatting and language identification are left as an exercise for the reader)