Either<L, R> constructor

Either<L, R>()

Either is an entity whose value can be of two different types, called left and right. By convention, Right is for the success case and Left for the error one.

Implementation

Either() {
  if (!isLeft && !isRight) {
    throw Exception('The Either should be heir Left or Right.');
  }
}