Skip to content

Instantly share code, notes, and snippets.

/post.scala
Created Aug 10, 2017

Embed
What would you like to do?
the description for this gist
val interpretWithMul = new LanguageWithMul[NoWrap] {
override def multiply(a: NoWrap[Int], b: NoWrap[Int]): NoWrap[Int] = a * b
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
You can’t perform that action at this time.