http://www.playframework.org/documentation/2.0/ScalaTodoListから
「~」は何をするのですか? また、マップの前にポイントが必要ないのはなぜですか?
val task = {
get[Long]("id") ~
get[String]("label") map {
case id~label => Task(id, label)
}
}
ご協力いただきありがとうございます。
http://www.playframework.org/documentation/2.0/ScalaTodoListから
「~」は何をするのですか? また、マップの前にポイントが必要ないのはなぜですか?
val task = {
get[Long]("id") ~
get[String]("label") map {
case id~label => Task(id, label)
}
}
ご協力いただきありがとうございます。
~
演算子は Scalaパーサーのコンビネーターから着想を得ており、行から 2 つの列の値を抽出できます。
map
Scalaでは points を記述する必要がないため、前にポイントはありません。