This abstract class defines the success and failure states.
in a Either<Success, Failure> manner. Use in cases where
it is necessary to handle errors more explicitly. This is done
by implemeting the when method as a pattern matching method.
Where the success callback is called if the result is a success, and
the failure callback is called if the result is a failure.