darq 0.3.1 darq: ^0.3.1 copied to clipboard
The power of lazy-evaluated enumerables in your hands! (A port of functional LINQ from the .NET library.)
[0.3.1] #
- Typedefs have been converted from a shorthand form to the full form. This should help with some type inference issues.
[0.3.0] #
- Unit tests have been added to ensure
Iterable
built-in functions behave as expected. - Default reducers for methods where a comparator is optional (such as
aggregatorE
,sumE
, andorderByE
) have been extended to also supportDuration
andBigInt
. - Custom error types have been overhauled to utilize default Dart error types:
UnexpectedStateError
,KeyExistsError
, andIntegerOverflowError
now extendStateError
instead ofError
.ConversionError
now extendsCastError
instead ofError
.IncompatibleTypeError
now extendsUnsupportedError
instead ofError
.NullEnumerableError
,EmptyEnumerableError
, andElementNotFoundError
have been merged intoEnumerableError
which extendsStateError
.OperationError
has been removed. Code that threwOperationError
now throwsStateError
with a descriptive message.
- Added subtype support for
ValueEnumerable
for specialized behavior when the sourceIterable
supports various actions. (Currently the only specialized subtype isListIterator
which enables short-circuiting forcountE
andelementAtE
methods to call the list'slength
property and indexer, respectively.) - Changed
countE
to call the underlying iterable'slength
property whencondition
is not specified. This should enable O(1) length calculations for default Dart collections that internally implementEfficientLengthIterable
. - Changed
EqualityComparer
to enable global setting of default comparers of new types. For example, for a custom typeFoo
, the static methodEqualityComparer.addDefaultEqualityComparer<Foo>(comparer)
will set the global default comparer forFoo
to the passedcomparer
values. Following this call, all calls to LINQ methods that take an optionalEqualityComparer<Foo>
will default to using the previously registered comparer when acomparer
is not specified.
Known Issues:
joinE
andgroupJoinE
have a problem with the type inference of the parameters, causing the types to default todynamic
. When calling these methods while specifying anEqualityComparer
, it may be necessary to explicitly state the type parameters as well as the types of parameters in any closure functions to get type inference to work properly.
[0.2.0] #
- The naming convention of the enumerable methods has been changed so that they are suffixed by the letter "e" (such as
selectE
,joinE
,whereE
). This is an attempt at a compromise between keeping the names of the methods consistent with their .NET origins while avoiding conflicts with existingIterable
methods. - Added two new factory methods to
Enumerable
:fromString
andgenerator
.fromString
converts aString
into anEnumerable
that iterates over each individual character, whilegenerator
allows an iterable to be created of the specified length using a given generator function. countIfE
has been merged withcountE
so thatcountE
now has aCondition
as an optional parameter. If theCondition
is provided, the behavior is identical tocountIfE
, and if not, the behavior is identical to the originalcountE
.- Fixed an issue where several of the enumerable methods were not asserting on required parameters.
[0.1.2] #
- Addressing pub description warnings.
[0.1.1] #
- Addressing pub formatting warnings and issues.
[0.1.0] #
- Initial release.