Skip to content

Commit

Permalink
Merge pull request #28 from Innmind/deprecations
Browse files Browse the repository at this point in the history
Deprecations
  • Loading branch information
Baptouuuu authored Nov 9, 2024
2 parents afe8ac4 + 044461c commit d4cc717
Show file tree
Hide file tree
Showing 10 changed files with 19 additions and 0 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@
- Use `static` closures as much as possible to reduce the probability of creating circular references by capturing `$this` as it can lead to memory root buffer exhaustion.
- Remove keeping intermediary values of a deferred `Sequence` that is referenced by no one.

### Deprecated

- `Innmind\Immutable\State`
- `Innmind\Immutable\Fold`

### Fixed

- Using `string`s or `int`s as a `Map` key type and then adding keys of different types was throwing an error.
Expand Down
3 changes: 3 additions & 0 deletions docs/structures/fold.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# `Fold`

??? warning "Deprecated"
`Fold` is deprecated and will be removed in the next major release.

The `Fold` monad is intented to work with _(infinite) stream of data_ by folding each element to a single value. This monad distinguishes between the type used to fold and the result type, this allows to inform the _stream_ that it's no longer necessary to extract elements as the folding is done.

An example is reading from a socket as it's an infinite stream of strings:
Expand Down
3 changes: 3 additions & 0 deletions docs/structures/state.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# `State`

??? warning "Deprecated"
`State` is deprecated and will be removed in the next major release.

The `State` monad allows you to build a set of pure steps to compute a new state. Since the initial state is given when all the steps are built it means that all steps are lazy, this use function composition (so everything is kept in memory).

The state and value can be of any type.
Expand Down
1 change: 1 addition & 0 deletions src/Fold.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
* @template R Result
* @template C Computation
* @psalm-immutable
* @deprecated
*/
final class Fold
{
Expand Down
1 change: 1 addition & 0 deletions src/Fold/Failure.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
* @implements Implementation<F1, R1, C1>
* @psalm-immutable
* @internal
* @psalm-suppress DeprecatedClass
*/
final class Failure implements Implementation
{
Expand Down
1 change: 1 addition & 0 deletions src/Fold/Implementation.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
* @template C Computation
* @psalm-immutable
* @internal
* @psalm-suppress DeprecatedClass
*/
interface Implementation
{
Expand Down
1 change: 1 addition & 0 deletions src/Fold/Result.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
* @implements Implementation<F1, R1, C1>
* @psalm-immutable
* @internal
* @psalm-suppress DeprecatedClass
*/
final class Result implements Implementation
{
Expand Down
1 change: 1 addition & 0 deletions src/Fold/With.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
* @implements Implementation<F1, R1, C1>
* @psalm-immutable
* @internal
* @psalm-suppress DeprecatedClass
*/
final class With implements Implementation
{
Expand Down
2 changes: 2 additions & 0 deletions src/State.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
* @psalm-immutable
* @template-covariant S
* @template-covariant T
* @deprecated
* @psalm-suppress DeprecatedClass
*/
final class State
{
Expand Down
1 change: 1 addition & 0 deletions src/State/Result.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
* @psalm-immutable
* @template S
* @template T
* @deprecated
*/
final class Result
{
Expand Down

0 comments on commit d4cc717

Please sign in to comment.