public final < T > T fold ( Function < ? super L , ? extends T > left , Function < ? super R , ? extends T > right ) { if ( isLeft ( ) ) { return left . apply ( getLeft ( ) ) ; } else { return right . apply ( getRight ( ) ) ; } }
Applies either the left or the right function as appropriate .