fxdart 0.2.2
fxdart: ^0.2.2 copied to clipboard
A functional programming library for Dart, ported from FxTS. Lazy evaluation, concurrent async iteration, and pipeline-style composition.
0.2.2 #
Renamed for Dart idiom #
toArray→toList,toArrayAsync→toListAsync(breaking). Dart has no "array" type — these have always returned aList, so they now carry the Dart-standard name. Applies to the top-level functions and thefx()/ async chain terminals. The old names are removed outright (not aliased): replacetoArray()→toList()andtoArrayAsync()→toListAsync().
Dart-idiomatic aliases added (both spellings supported) #
Every FxTS operator whose Dart Iterable/collection counterpart has a different
established name now exposes both names — the FxTS name for parity and the
Dart-idiomatic name as a first-class alias. Nothing is removed (that was
toArray's special case above); existing code keeps working, and the FxDart 101
course teaches the Dart-idiomatic spelling. Aliases exist at every level: the
top-level functions (+ their *Async twins), the fx() chain, and the async
FxAsync chain. On the sync chain several Dart names come for free because
Fx extends Iterable (Dart 3): firstOrNull, lastOrNull, elementAtOrNull,
any, forEach, length, indexed, nonNulls, contains.
Type-name aliases — the FxTS name claims a type Dart doesn't have:
| FxTS name | Dart-idiomatic alias |
|---|---|
unicodeToArray |
unicodeToList |
isBoolean |
isBool |
isNumber |
isNum |
isDate |
isDateTime |
Standard-library vocabulary aliases:
| FxTS name | Dart-idiomatic alias |
|---|---|
head |
firstOrNull |
last |
lastOrNull |
nth |
elementAtOrNull |
find |
firstWhereOrNull |
findIndex |
indexWhere |
some |
any |
size |
count (or .length on the chain) |
each |
forEach |
filter |
where |
reject |
whereNot |
flatMap |
expand |
flat |
flattened |
drop / dropWhile |
skip / skipWhile |
uniq / uniqBy |
distinct / distinctBy |
zipWithIndex |
indexed |
compact |
nonNulls |
toSorted |
sorted |
takeRight |
takeLast |
includes keeps only its FxTS spelling at the top level — a top-level contains
would collide with package:test's matcher; use the inherited .contains() on
the chain for the Dart idiom. See test/dart_aliases_test.dart for the
both-spellings contract.
Left as-is — already Dart-idiomatic or intentionally FP with no stdlib
counterpart: map, take, takeWhile, reduce, fold, join,
sum/min/max/average, every, isEmpty, isNull/isNotNull,
isString/isList/isMap, and the combinator/pipe family (identity,
tap, memoize, curried, pipe, …).
0.2.1 #
- READEME.md update
0.2.0 #
- Comprehensive docs site overhaul: tutorials for
curried/uncurriedandcreateSeededRandomnow part of the FxDart 101 course with live in-browser playground examples. - Logo and branding refresh for docs site.
- Enhanced playground bundle with full currying extensions support.
0.1.3 #
- Docs site: new tutorials for
curried/uncurriedandcreateSeededRandom(previously undocumented), wired into the FxDart 101 course; the playground bundle now includes the currying extensions.
0.1.2 #
.curried/.uncurriedextension getters (arity 2–5): a fully typed, Dart-native replacement for FxTScurry, resolved statically per arity. Design rationale in WHY_CURRIED.md. The untypedcurrystub's deprecation now points at.curried.
0.1.1 #
concurrentPoolnow eagerly keeps its pool full (FxTS behavior): even one-pull-at-a-time consumers liketoArray()get full overlap and completion-order results.- Docs site (GitHub Pages) with a live in-browser playground for every
function, under
docs/.
0.1.0 #
- Complete rewrite: port of FxTS to Dart.
- Lazy sync operators over plain
Iterables (map,filter,take,chunk,zip, ...). - Pull-based
FxAsyncIterableprotocol with FxTS-styleconcurrent(n)/concurrentPool(n)evaluation andStreambridges (fromStream,toStream). - Typed
fx()/FxAsyncchain API; dynamicpipe/pipeLazyfor parity. - Strict functions (
reduce,groupBy,sortBy,partition, ...), Map-based object functions (omit,pick,evolve,isMatch, ...), and Util (debounce,throttle,shuffle). - Unportable TS APIs kept as
@Deprecatedstubs (curry,isUndefined,isArray,isObject). - 850+ tests ported from the FxTS spec suite.
0.0.1 #
- Initial update, Add concept inspired by FxJs