Releases: bonami/collections
Releases · bonami/collections
0.5.0
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>
andIterable1<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 argumentslift1
up tolift30
. Genericlift
method still stays intact. TrySafe::getUnsafe
now returns previous failure inValueIsNotPresentException
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 contextproduct(Applicative<A>, Applicative<B>): Applicative<{A, B}>
product
mentioned above is internally used to deriveap
,traverse
andsequence
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 oldLambda
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 argumentscurry1
up tocurry30
. There is also genericcurry
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 ofLambda
. It was replaced withCurriedFunction
, which repesents single argument function. It providescurryN
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
0.4.3
0.4.2
Features
- Support for php 8.1
Breaking changes
getIterator
on multiple structures now returnsIterator
rather thenTraversable
. This should be very very minor BC, sinceIterator
is just more rich interface thenTraversable
. 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
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
Features
- Fix return type of ArrayList::map()
0.4.0
Features
- Better compatibility with phpstan 1.x
Breaking changes
- Drop support of php 7.2
LazyList::getIterator()
returnsIterator
rather thenTraversable
(this should be minor break, Iterator has more rich interface then Traversable)- Drop
LazyList::fromTraversable()
, because it was redundant withLazyList::fromIterable()
0.3.8
Features
This release improves usability of Option
with some new operations
isEmpty
to check whether the value is defined or not. It is counterpart forisDefined
and aligns well w/ other structurestapNone
to allow executing side effect when Option is none. This is handy when some logging is needed in case of empty valuestoEither
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 definedtoList
similar totoArray
, direct conversion to emptyArrayList
or single elementArrayList
0.3.7
0.3.6: Add helper to easily convert array list into lazy
Features
- Add
lazy
operation for convertingArrayList
intoLazyList