src/Pure/General/value.scala
changeset 68944 ce68b1488612
parent 63805 c272680df665
child 68946 6dd1460f6920
     1.1 --- a/src/Pure/General/value.scala	Sat Sep 08 12:01:37 2018 +0200
     1.2 +++ b/src/Pure/General/value.scala	Sat Sep 08 12:18:15 2018 +0200
     1.3 @@ -51,4 +51,12 @@
     1.4      def parse(s: java.lang.String): scala.Double =
     1.5        unapply(s) getOrElse error("Bad real: " + quote(s))
     1.6    }
     1.7 +
     1.8 +  object Seconds
     1.9 +  {
    1.10 +    def apply(x: Time): java.lang.String = x.toString
    1.11 +    def unapply(s: java.lang.String): Option[Time] = Double.unapply(s).map(Time.seconds(_))
    1.12 +    def parse(s: java.lang.String): Time =
    1.13 +      unapply(s) getOrElse error("Bad real (for seconds): " + quote(s))
    1.14 +  }
    1.15  }