Skip to content

Commit d4cc717

Browse files
authored
Merge pull request #28 from Innmind/deprecations
Deprecations
2 parents afe8ac4 + 044461c commit d4cc717

File tree

10 files changed

+19
-0
lines changed

10 files changed

+19
-0
lines changed

CHANGELOG.md

+5
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,11 @@
1111
- 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.
1212
- Remove keeping intermediary values of a deferred `Sequence` that is referenced by no one.
1313

14+
### Deprecated
15+
16+
- `Innmind\Immutable\State`
17+
- `Innmind\Immutable\Fold`
18+
1419
### Fixed
1520

1621
- Using `string`s or `int`s as a `Map` key type and then adding keys of different types was throwing an error.

docs/structures/fold.md

+3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# `Fold`
22

3+
??? warning "Deprecated"
4+
`Fold` is deprecated and will be removed in the next major release.
5+
36
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.
47

58
An example is reading from a socket as it's an infinite stream of strings:

docs/structures/state.md

+3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# `State`
22

3+
??? warning "Deprecated"
4+
`State` is deprecated and will be removed in the next major release.
5+
36
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).
47

58
The state and value can be of any type.

src/Fold.php

+1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
* @template R Result
1616
* @template C Computation
1717
* @psalm-immutable
18+
* @deprecated
1819
*/
1920
final class Fold
2021
{

src/Fold/Failure.php

+1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
* @implements Implementation<F1, R1, C1>
1717
* @psalm-immutable
1818
* @internal
19+
* @psalm-suppress DeprecatedClass
1920
*/
2021
final class Failure implements Implementation
2122
{

src/Fold/Implementation.php

+1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
* @template C Computation
1616
* @psalm-immutable
1717
* @internal
18+
* @psalm-suppress DeprecatedClass
1819
*/
1920
interface Implementation
2021
{

src/Fold/Result.php

+1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
* @implements Implementation<F1, R1, C1>
1717
* @psalm-immutable
1818
* @internal
19+
* @psalm-suppress DeprecatedClass
1920
*/
2021
final class Result implements Implementation
2122
{

src/Fold/With.php

+1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
* @implements Implementation<F1, R1, C1>
1717
* @psalm-immutable
1818
* @internal
19+
* @psalm-suppress DeprecatedClass
1920
*/
2021
final class With implements Implementation
2122
{

src/State.php

+2
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
* @psalm-immutable
1010
* @template-covariant S
1111
* @template-covariant T
12+
* @deprecated
13+
* @psalm-suppress DeprecatedClass
1214
*/
1315
final class State
1416
{

src/State/Result.php

+1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
* @psalm-immutable
88
* @template S
99
* @template T
10+
* @deprecated
1011
*/
1112
final class Result
1213
{

0 commit comments

Comments
 (0)