Skip to content

Instantly share code, notes, and snippets.

Created Aug 10, 2017
What would you like to do?
the description for this gist
type NoWrap[ScalaValue] = ScalaValue
val interpret = new Language[NoWrap] {
override def number(v: Int): NoWrap[Int] = v
override def increment(a: NoWrap[Int]): NoWrap[Int] = a + 1
override def add(a: NoWrap[Int], b: NoWrap[Int]): NoWrap[Int] = a + b
override def text(v: String): NoWrap[String] = v
override def toUpper(a: NoWrap[String]): NoWrap[String] = a.toUpperCase
override def concat(a: NoWrap[String], b: NoWrap[String]): NoWrap[String] = a + " " + b
override def toString(v: NoWrap[Int]): NoWrap[String] = v.toString
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment