Created
August 10, 2017 06:32
-
-
Save anonymous/20a5de1c0c2d569251cad332e91cd693 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
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