Skip to content

Instantly share code, notes, and snippets.

@deepakmehra10
Created July 14, 2019 07:52
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 deepakmehra10/d9770aa34e82fcbcb20fc5570548e3a2 to your computer and use it in GitHub Desktop.
Save deepakmehra10/d9770aa34e82fcbcb20fc5570548e3a2 to your computer and use it in GitHub Desktop.
//lifting
Function2<Integer, Integer, Integer> divide = (first, second) -> first / second;
Function2<Integer, Integer, Option<Integer>> lift = Function2.lift(divide);
// None
System.out.println(lift.apply(1, 0));
//Some value
System.out.println(divide.apply(1, 1));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment