Skip to content

Commit

Permalink
Readme : Update type definitions and enhance type composition explana…
Browse files Browse the repository at this point in the history
…tion

The `AnyOf` type definition has been adjusted to replace `Both` with `BothOf` for consistency in naming. Additional context was added about the `Any<T, U>` type as a couple of optional values. Minor corrections were made to clarify function syntax and improve examples.
  • Loading branch information
Trehinos committed Feb 9, 2025
1 parent df0376a commit 66fa6e8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,9 @@ manner.
```
- Its cases are:
```
AnyOf(L, R) = Neither | Left(L) | Right(R) | Both({left: L, right: R})
AnyOf(L, R) = Neither | Left(L) | Right(R) | BothOf{left: L, right: R}
```
- This type can also be viewed as a product of two optional types:
-
```
AnyOf<L, R>::any() -> (Option<L>, Option<R>)
```
Expand Down Expand Up @@ -73,6 +72,7 @@ manner.
4. **Enhanced Type Composition**
- A `Couple<T, U>` is a `(T, U)`,
- A `Pair<T>` is a `Couple<T, T>`,
- An `Any<T, U>` is a `Couple<Option<T>, Option<U>>`,
- Complex types like `AnyOf4`, `AnyOf8`, and `AnyOf16` are implemented for handling larger,
structured combinations via nested `AnyOf` structures.
- The `LeftOrRight` trait :
Expand Down Expand Up @@ -117,7 +117,7 @@ It is inspired by the Haskel's `Either` type.
* Unlike the Rust's `Result` type, the types `AnyOf`, `EitherOf` or `LeftOrRight` have not an "error" semantic, they are
general purpose,
* Any `LeftOrRight<L, R>::any` can be represented by a `(Option<L>, Option<R>)` which is a product of two optional
* `LeftOrRight<L, R>::any()` can be represented by a `(Option<L>, Option<R>)` which is a product of two optional
types, but the two types has not the same composition conciseness :
```
AnyOf<AnyOf<LL, LR>, AnyOf<RL, RR>>
Expand Down

0 comments on commit 66fa6e8

Please sign in to comment.