Skip to content

Instantly share code, notes, and snippets.

@dorsev
Created November 3, 2018 21:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dorsev/b35957d3d9d65b0ca7a7b1e70c46c6ea to your computer and use it in GitHub Desktop.
Save dorsev/b35957d3d9d65b0ca7a7b1e70c46c6ea to your computer and use it in GitHub Desktop.
Eta Expansion in scala - p1
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