Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Java Wars VIII: The Function Awakens

Java Wars VIII: The Function Awakens

Grzegorz Piwowarek

April 11, 2016
Tweet

More Decks by Grzegorz Piwowarek

Other Decks in Programming

Transcript

  1. lambda expressions x -> x + 1 GitHub, Twitter ::

    @pivovarit () -> 42 () -> {return 42;}
  2. lambda expressions x -> x + 1 GitHub, Twitter ::

    @pivovarit () -> 42 (x, y) -> {} () -> {return 42;}
  3. lambda expressions x -> x + 1 - No type

    information GitHub, Twitter :: @pivovarit
  4. Function<T, R>, BiFunction<T,U,R> Consumer<T> extends Function<T,Void> Supplier<T> extends Function<Void, T>

    Predicate<T> extends Function<T, Boolean> UnaryOperator<T> extends Function<T, T> BinaryOperator<T> extends BiFunction<T,T,T> GitHub, Twitter :: @pivovarit
  5. Function<T, R>, BiFunction<T,U,R> Consumer<T> extends Function<T,Void> Supplier<T> extends Function<Void, T>

    Predicate<T> extends Function<T, Boolean> UnaryOperator<T> extends Function<T, T> BinaryOperator<T> extends BiFunction<T,T,T> GitHub, Twitter :: @pivovarit
  6. Function<T, R>, BiFunction<T,U,R> Consumer<T> extends Function<T,Void> Supplier<T> extends Function<Void, T>

    Predicate<T> extends Function<T, Boolean> UnaryOperator<T> extends Function<T, T> BinaryOperator<T> extends BiFunction<T,T,T> GitHub, Twitter :: @pivovarit
  7. Function<T, R>, BiFunction<T,U,R> Consumer<T> extends Function<T,Void> Supplier<T> extends Function<Void, T>

    Predicate<T> extends Function<T, Boolean> UnaryOperator<T> extends Function<T, T> BinaryOperator<T> extends BiFunction<T,T,T> GitHub, Twitter :: @pivovarit
  8. Function<T, R>, BiFunction<T,U,R> Consumer<T> extends Function<T,Void> Supplier<T> extends Function<Void, T>

    Predicate<T> extends Function<T, Boolean> UnaryOperator<T> extends Function<T, T> BinaryOperator<T> extends BiFunction<T,T,T> GitHub, Twitter :: @pivovarit
  9. REFERENCES: -"MONADIC JAVA" BY MARIO FUSCO -"WHAT'S WRONG WITH JAVA

    8" BY PIERRE-YVES SAUMONT -WWW.ORACLE.COM -"A FISTFUL OF MONADS" - LEARN YOU A HASKELL FOR GREAT GOOD