While going through the scala documentation (Play Docs) of the play framework I saw a syntax I have never seen before.
val populations:List[String~Int] = {
SQL("select * from Country").as( str("name") ~ int("population") * )
}
Could someone please tell me what does “~” in List[String~Int] mean?
May be this willl help:
Actually,
~is not a part of the standard library, this is a generic class from the play framework, which allows an infix notation. In scala, any generic class that takes 2 generic parameters can be use with an infix notation. for example, the following also works:In your case, you will find the definition of
~in the Play framework API.