toOption method

  1. @override
Option<R> toOption()
override

Convert this Either to a Option:

  • If the Either is Left, throw away its value and just return None
  • If the Either is Right, return a Some containing the value inside Right

Implementation

@override
Option<R> toOption() => Some(_value);