Created
July 14, 2019 07:52
-
-
Save deepakmehra10/d9770aa34e82fcbcb20fc5570548e3a2 to your computer and use it in GitHub Desktop.
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
//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