fold<B> abstract method

B fold<B>(
  1. B onSome(
    1. T value
    ),
  2. B onNone()
)

Fold is used to handle both Some and None cases.

Implementation

B fold<B>(B Function(T value) onSome, B Function() onNone);