CCG coded in Scala