consume method
Implementation
Optional<O> consume() {
return cases.entries.fold(empty<O>(), (carry, entry) {
return carry is Empty<O> && entry.key(value) // @formatter:off
? present(entry).map((match) => match.value(value))
: carry; // @formatter:on
});
}