Created
November 3, 2018 21:53
-
-
Save dorsev/b35957d3d9d65b0ca7a7b1e70c46c6ea to your computer and use it in GitHub Desktop.
Eta Expansion in scala - p1
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
scala>val emphasisFunc = (str:String) = s"$str!!!"" | |
emphasisFunc: (str: String)String | |
scala>emphasisFunc | |
def emphasisFunc(str: String): String | |
scala> emphasisFunc("abc") | |
res0: String = abc!!! | |
scala> List("hello","world").map(emphasisFunc) | |
res1: List[String] = List(hello!!!, world!!!) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment