次のように機能する function を記述する必要があるとconvert[T]: String => Option[T]
します。
import scala.util.Try
def toInt(s: String): Option[Int] = Try(s.toInt).toOption
def toDouble(s: String): Option[Double] = Try(s.toDouble).toOption
def toBoolean(s: String): Option[Boolean] = Try(s.toBoolean).toOption
// if T is either Int, Double, or Boolean return
// toInt(s), toDouble(s), toBoolean(s) respectively
def convert[T](s: String): Option[T] = ???
TypeTag
それを実装するために使用する必要がありますか?