19declare(strict_types=1);
41 if ($this->todo ===
'') {
44 return ord($this->todo[0]);
49 return new Ok((
new self(
50 substr($this->todo, 1),
55 public function push(array $values): self
59 array_merge($this->
accepted, $values)
65 return new Error(
'Rejected.');
73 public function done(): bool
99 $string .=
$data->value();
102 return $transform($string);
A result encapsulates a value or an error and simplifies the handling of those.
Class for internal usage of Intermediate.
A result encapsulates a value or an error and simplifies the handling of those.