Skip to content

Instantly share code, notes, and snippets.

Created June 15, 2017 06:55
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 anonymous/0f90cad148480e7599ae1c750c598819 to your computer and use it in GitHub Desktop.
Save anonymous/0f90cad148480e7599ae1c750c598819 to your computer and use it in GitHub Desktop.
the description for this gist
// successful downcasting
stringToIntPrism.getOption("22")
// res: Option[Int] = Some(22)
// failed downcasting
stringToIntPrism.getOption("abc")
// res: Option[Int] = None
// upcasting (always succeeds)
stringToIntPrism.reverseGet(22)
// res: String = 22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment