diff --git a/README.md b/README.md index 3eac309..818aaad 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,8 @@ This project contains PHP utility classes whose functionality is inspired by their F# counterparts. +The v2 series requires at least PHP 8.4. A similar API exists for PHP 8.2 - 8.3 in version 1 of this project; see its README for specifics. + ## What It Provides This early-stage library currently provides two classes, both of which are designed to wrap values and indicate the state of the action that produced them. `Option` represents a variable that may or may not have a value. `Result` represents the result of an action; the "ok" and "error" states both provide a value. @@ -11,12 +13,12 @@ This early-stage library currently provides two classes, both of which are desig | **Creating** | `::Some(T)` for Some | `::OK(TOK)` for OK | | | `::None()` for None | `::Error(TError)` for Error | | | `::of($value)` _None if `null`_ | | -| **Querying** | `->isSome(): bool` | `->isOK(): bool` | -| | `->isNone(): bool` | `->isError(): bool` | +| **Querying** | `->isSome: bool` | `->isOK: bool` | +| | `->isNone: bool` | `->isError: bool` | | | `->contains(T, $strict = true): bool` | `->contains(TOK, $strict = true): bool` | | | `->exists(callable(T): bool): bool` | `->exists(callable(TOK): bool): bool` | -| **Reading**
| `->get(): T` | `->getOK(): TOK` | -| _all throw if called on missing value_ | | `->getError(): TError` | +| **Reading**
| `->value: T` | `->ok: TOK` | +| _all throw if called on missing value_ | | `->error: TError` | | **Transforming**
| `->map(callable(T): TMapped): Option` | `->map(callable(TOK): TMapped): Result` | | _all still `Option` or `Result`_ | | `->mapError(callable(TError): TMapped): Result` | | **Iterating** | `->iter(callable(T): void): void` | `->iter(callable(TOK): void): void` |