예제 #1
0
 /**
  * This method returns the swapped node.
  *
  * @access public
  * @static
  * @param IEither\Type $x                                   the node to be swapped
  * @return IEither\Type                                     a tuple with the item swapped
  */
 public static function swap(IEither\Type $x) : IEither\Type
 {
     $value = $x->unbox();
     return $x->__isLeft() ? IEither\Type::right($value) : IEither\Type::left($value);
 }