How to understand Anorm parser?

From http://www.playframework.org/documentation/2.0/ScalaTodoList

What does "~" do and why don't I need a dot in front of the map?

val task = { get[Long]("id") ~ get[String]("label") map { case id~label => Task(id, label) } } 

Thanks for your help.

+6
source share
1 answer

The ~ operator ~ inspired by Scala parser combinators ; it allows you to extract two column values ​​from a row.

There is no point to map , because in Scala you do not need to write points .

+2
source

Source: https://habr.com/ru/post/913249/


All Articles