Skip to content

Releases: bonami/collections

0.5.0

09 Aug 08:42
Compare
Choose a tag to compare
0.5.0 Pre-release
Pre-release

This release changes internally how abstractions are made for "type classes". We extracted some common logic into traits, to reduce duplication.

It helps to normalize interface of types and it allows faster implementation of common features amongst them. Creating new types should be easier now.

Features

  • Experimental: new traits for type class abstractions: Applicative1<A>, Applicative2<A. B>, Monad1<A>, Monad2<A, B> and Iterable1<A>.They are used internally and once stable, you can use them for your own types.
  • There are "typed" versions of lift method or up to 30 arguments. Each method has number for the number of arguments lift1 up to lift30. Generic lift method still stays intact.
  • TrySafe::getUnsafe now returns previous failure in ValueIsNotPresentException to allow checking what was the original cause
  • Added ArrayList::add to allow immutable adding of single element
  • Added product static method supported on all applicatives. It takes two values in applicative context and combines them into pair in applicative context product(Applicative<A>, Applicative<B>): Applicative<{A, B}>
  • product mentioned above is internally used to derive ap, traverse and sequence implementation, which let to simplier implementation and more performant one.
  • Added LazyList::doWhile to support materializing the list until certain predicate is met
  • A new CurriedFunction was added which represent single argument function, which replaces old Lambda type. More on this in BC section.
  • There are "typed" versions of curry method or up to 30 arguments. Each method has number for the number of arguments curry1 up to curry30. There is also generic curry method.

Breaking changes

  • Lambda was dropped. It served as wrapper around any callable and allowed partial applying in very dynamic way. Although it was quite flexible (you could call it in curry way, normally or something between) it was impossible to track types because of dynamic nature of Lambda. It was replaced with CurriedFunction, which repesents single argument function. It provides curryN factories to transform callable with up to 30 arguments into chain of curried functions. This way we can easily track types.
  • Minimal php version is 7.4

0.4.4

09 Aug 08:09
Compare
Choose a tag to compare
0.4.4 Pre-release
Pre-release

Features

  • add doWhile on LazyList. This allows materializing the list until certain predicate is met

0.4.3

06 Jan 21:46
Compare
Choose a tag to compare
0.4.3 Pre-release
Pre-release

Bugfixes

  • Fix compatibility with php 8.1 by adding explicit return type for Enum::jsonSerialize() b10be92

0.4.2

16 Dec 10:49
Compare
Choose a tag to compare
0.4.2 Pre-release
Pre-release

Features

  • Support for php 8.1

Breaking changes

  • getIterator on multiple structures now returns Iterator rather then Traversable. This should be very very minor BC, since Iterator is just more rich interface then Traversable. Therefore no BC expected in client code.

CI / Dev

  • Fixed matrix definition for CI (php versions are correctly used, previously it run on latest php by accident)
  • Removed 7.2 from CI and added 8.1
  • Makefile uses php:7.3-cli-alpine docker image to run things

0.3.9: Run things in Makefile with php 7.2

16 Dec 10:14
Compare
Choose a tag to compare

Features

  • none

Bugfixes

  • Better reporting of missing key when Map::get() is called
  • Fixed return typehint (for phpstan) in ArrayList::map()

CI / Dev

  • Fixed matrix definition for CI (php versions are correctly used, previously it run on latest php by accident)
  • Downgraded phpunit to be able to run on php 7.2
  • Makefile uses php:7.2-cli-alpine docker image to run things

0.4.1: Fix return type of ArrayList::map

23 Nov 15:19
Compare
Choose a tag to compare

Features

  • Fix return type of ArrayList::map()

0.4.0

23 Nov 13:09
Compare
Choose a tag to compare
0.4.0 Pre-release
Pre-release

Features

  • Better compatibility with phpstan 1.x

Breaking changes

  • Drop support of php 7.2
  • LazyList::getIterator() returns Iterator rather then Traversable (this should be minor break, Iterator has more rich interface then Traversable)
  • Drop LazyList::fromTraversable(), because it was redundant with LazyList::fromIterable()

0.3.8

15 Nov 14:16
Compare
Choose a tag to compare
0.3.8 Pre-release
Pre-release

Features

This release improves usability of Option with some new operations

  • isEmpty to check whether the value is defined or not. It is counterpart for isDefined and aligns well w/ other structures
  • tapNone to allow executing side effect when Option is none. This is handy when some logging is needed in case of empty values
  • toEither direct conversion method with possible left side definition on empty.
  • toArray direct conversion to empty array when Option is empty and single element array when Option is defined
  • toList similar to toArray, direct conversion to empty ArrayList or single element ArrayList

0.3.7

15 Nov 14:00
Compare
Choose a tag to compare
0.3.7 Pre-release
Pre-release

Features

  • Add findKey operation for finding first key matching specific predicate on Map

0.3.6: Add helper to easily convert array list into lazy

15 Nov 13:59
Compare
Choose a tag to compare

Features

  • Add lazy operation for converting ArrayList into LazyList