Functional Programming Flashcards
What is a lambda ?
An anonymous function
Predefined Functional Interface - Predicate
Generic type
Check a condition, returns true or false
Primitive specializations exist
Predicate<T>
T-> boolean</T>
Predefined Functional Interface - Consumer
Accepts an argument and returns nothing
Consumer<T>
T-> void</T>
Predefined Functional Interface - Function
Accepts type T, Returns type R
performs a function
Primitive specializations exist
Function<T,R>
T->R
Predefined Functional Interface - Supplier
takes nothing but supplier something of type T
Supplier<T>
()->T</T>
Predefined Functional Interface - Unary
Accepts type T and returns a result of the same type
UnaryOperator<T>
T->T</T>
Predefined Functional Interface - BinaryOperator<T>
(T,T)->T</T>
BinaryOperator<T>
(T,T)->T</T>
Predefined Functional Interface -
BiPredicate
BiPredicate<L,R>
(L,R)->boolean
Predefined Functional Interface -
BiConsumer
BiConsumer<T,U>
(T,U)-> void