-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* develop: (26 commits) specify next release increase the scenarii per proof when coverage enable to better cover conditions on generated types Revert "increase the number of scenarii per proof in the CI" increase the number of scenarii per proof in the CI add workflow to automatically create a release fix deprecations move deprecations messages to the top for better visibility deprecate the Fold monad deprecate the State monad move Sequence\Defer::load() to ::memoize() update changelog make sure via a stack trace that values are accumulated only once when intermediary sequences are not used do not accumulate values inside deferred sequences that nobody references remove the need to store generator keys add proofs that deferred identity/maybe holds intermediary values update changelog avoid capturing $this for a deferred either avoid capturing $this for a deferred maybe avoid capturing $this for a deferred identity fix deferred Identity::flatMap being lazy and not deferred ...
- Loading branch information
Showing
37 changed files
with
733 additions
and
147 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
name: Create release | ||
|
||
on: | ||
push: | ||
tags: | ||
- '*' | ||
|
||
permissions: | ||
contents: write | ||
|
||
jobs: | ||
release: | ||
name: Create release | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- name: Create release | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
tag: ${{ github.ref_name }} | ||
run: | | ||
gh release create "$tag" \ | ||
--repo="$GITHUB_REPOSITORY" \ | ||
--generate-notes |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<?php | ||
declare(strict_types = 1); | ||
|
||
use Innmind\Immutable\Map; | ||
use Innmind\BlackBox\Set; | ||
|
||
return static function() { | ||
yield proof( | ||
'Map::toSequence()', | ||
given( | ||
Set\Sequence::of(Set\Type::any()), | ||
Set\Sequence::of(Set\Type::any()), | ||
), | ||
static function($assert, $keys, $values) { | ||
$map = Map::of(); | ||
|
||
foreach ($keys as $index => $key) { | ||
$map = ($map)($key, $values[$index] ?? null); | ||
} | ||
|
||
$assert->true( | ||
$map->equals(Map::of( | ||
...$map | ||
->toSequence() | ||
->map(static fn($pair) => [$pair->key(), $pair->value()]) | ||
->toList(), | ||
)), | ||
); | ||
}, | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
<?php | ||
declare(strict_types = 1); | ||
|
||
use Innmind\Immutable\Maybe; | ||
use Innmind\BlackBox\Set; | ||
|
||
return static function() { | ||
yield proof( | ||
'Maybe::defer() holds intermediary values', | ||
given( | ||
Set\Type::any(), | ||
Set\Type::any(), | ||
), | ||
static function($assert, $value1, $value2) { | ||
$m1 = Maybe::defer(static function() use ($value1) { | ||
static $loaded = false; | ||
|
||
if ($loaded) { | ||
throw new Exception; | ||
} | ||
|
||
$loaded = true; | ||
|
||
return Maybe::just($value1); | ||
}); | ||
$m2 = $m1->map(static fn() => $value2); | ||
|
||
$assert->same( | ||
$value2, | ||
$m2->match( | ||
static fn($value) => $value, | ||
static fn() => null, | ||
), | ||
); | ||
$assert->not()->throws( | ||
static fn() => $assert->same( | ||
$value1, | ||
$m1->match( | ||
static fn($value) => $value, | ||
static fn() => null, | ||
), | ||
), | ||
); | ||
}, | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.