Created
August 10, 2017 06:32
-
-
Save anonymous/83a7348a8f359db6cfb0ad79009c53c1 to your computer and use it in GitHub Desktop.
the description for this gist
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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