Skip to content

Releases: fp4php/functional

Release v4.15.0

27 Dec 07:52
Compare
Choose a tag to compare
  • Stream::sorted operation has been added

Release v4.14.0

26 Dec 16:45
Compare
Choose a tag to compare
  • Option::when and Option::unless have been added
  • Deprecate Option::cond and Option::condLazy. Use Option::when

Release v4.13.0

24 Dec 19:04
Compare
Choose a tag to compare
  • Set intersect operation
  • NonEmptySet intersect operation
  • Set diff operation
  • NonEmptySet diff operation
>>> HashSet::collect([1, 2, 3])
    ->intersect(HashSet::collect([2, 3]))->toArray();
=> [2, 3]


>>> HashSet::collect([1, 2, 3])
    ->diff(HashSet::collect([2, 3]))->toArray();
=> [1]

Release v4.12.0

24 Dec 12:45
Compare
Choose a tag to compare
  • asPairs function
  • asPairsGenerator function
  • fix asGenerator namespace (Callable -> Cast)
>>> asPairs(['a' => 1, 'b' => 2]);
=> [['a', 1], ['b', 2]]

>>> Stream::emits(asPairsGenerator(['a' => 1, 'b' => 2]));
=> [['a', 1], ['b', 2]]

Release v4.11.0

21 Dec 21:47
Compare
Choose a tag to compare
  • Stream toAssocArray cast
>>> Stream::emits([[1, 'a'], [2, 'b']])->toAssocArray(fn($pair) => $pair);
=> [1 => 'a', 2 => 'b']

Release v4.10.0

18 Dec 18:37
Compare
Choose a tag to compare
  • fix Option::fold and Either::fold signatures.
  • add Option::toArrayList cast method.
>>> Option::some(1)
    ->toArrayList(ArrayList::singleton(...))
    ->toArray();
=> [1]

>>> Option::some([1])
    ->toArrayList(ArrayList::collect(...))
    ->toArray();
=> [1]

>>> Option::none()
    ->toArrayList(ArrayList::collect(...))
    ->toArray();
=> []

Release v4.9.0

18 Dec 00:04
Compare
Choose a tag to compare
  • Option getOrThrow method
>>> Option::some(1)->getOrThrow(fn() => new RuntimeException('???'));
=> 1

>>> Option::none()->getOrThrow(fn() => new RuntimeException('???'));
RuntimeException with message '???'

Release v4.8.1

14 Dec 20:17
03e76ae
Compare
Choose a tag to compare

Fix Either::flatMap signature by @klimick in #45

Release v4.8.0

13 Dec 14:42
Compare
Choose a tag to compare
  • range collector for Seq
  • replace 0|positive-int with int for range start and stop parameters.
>>> ArrayList::range(0, 10, 2)->toArray();
=> [0, 2, 4, 6, 8]

>>> ArrayList::range(0, 3)->toArray();
=> [0, 1, 2]

>>> ArrayList::range(0, 0)->toArray();
=> []

Release v4.7.0

08 Dec 11:47
Compare
Choose a tag to compare
  • Add lastOf operation for Seq and NonEmptySeq