/** * This method returns an option using the head for the boxed object. * * @access public * @static * @param IArrayList\Type $xs the left operand * @return IOption\Type the option */ public static function headOption(IArrayList\Type $xs) : IOption\Type { return $xs->__isEmpty() ? IOption\Type::none() : IOption\Type::some($xs->head()); }