2.2.02026-03-12
Fallible Operations (try*)
Fallible collection operations now use a try prefix, inspired by Gleam's naming convention and mirroring stdlib's collection API more closely. Several new operations have also been added.
- Rename mapResult functions to tryMap, mapAll to tryMap, fold/foldRight to tryFold/tryFoldRight (d052cf5c4c2cad12f9bb04686d5ecbf82fbf8ec6)
- The previous names are deprecated with @Deprecated + ReplaceWith for easy migration
- Add tryFind, tryFindLast, tryForEach, tryForEachIndexed, tryReduce, tryReduceIndexed for Iterable (d2011f025873286cc550cab4174a5280560a01cd)
- Add tryFilter, tryAssociate, tryFlatMap, tryGroupBy, tryPartition + variants for Iterable (f32985e4c9bafa0f4356aaca710245889b5acc15)
Flow Extensions
The kotlin-result-coroutines module now includes extensions for the kotlinx-coroutines Flow type, bringing the same Result-aware operations available on Iterable to asynchronous streams. This was born out of the discussion in #78.
- Add Flow extensions for kotlin-coroutines (15d44a0c86795de5aa1899d68db2f2991cd9324a)
- Factory: Result<Flow<V>, E>.toFlow()
- Flow: filterOk, filterErr, onEachOk, onEachErr, allOk, allErr, anyOk, anyErr, countOk, countErr, partition, combine, combineErr
- Try: tryFilter, tryFilterNot, tryMap, tryMapNotNull, tryFlatMap, tryForEach, tryReduce, tryFold, tryFind, tryFindLast, tryAssociate, tryAssociateBy, tryAssociateWith, tryGroupBy, tryPartition
Other
- Rename onSuccess/onFailure to onOk/onErr (a7c66c0d8750c2602c748007a32b613a4e3c3220)
- The new indexed variants (onEachOkIndexed, onEachErrIndexed) proved that the Success/Failure naming becomes too verbose. Ok/Err is more readable.
- Rename filterValues/filterErrors to filterOk/filterErr (87f4c36364b849313644fb8465f6e9091983117d)
- Aligns naming with existing allOk/allErr/anyOk/anyErr/countOk/countErr conventions
- Add onEachOk, onEachOkIndexed, onEachErr, onEachErrIndexed for Iterable<Result> (a7c66c0d8750c2602c748007a32b613a4e3c3220)
- Add combineErr and combineTo/combineErrTo for Iterable<Result> (1133e00a8ac14d7d45a2c492f779c55ae5198f07, c06eeb373f81f582da9c101629ba50afb6f558f3)
- Propagate nested coroutineBinding failures by @dbottillo (d952b52141608f653855883f1cc6274d121341a2)
- Closes #128 and #133
- Make BindingException public (549ed30d0a7bed36175c2f6abcc0d93c830c7642)
- Fixes 'internal' type accessed from public inline declaration warning that will become an error in Kotlin 2.4
- Update Kotlin to 2.3.10 (12ceff754cb5ace39720a45603ae5c0dacf87b67)
- Update Gradle to 9.4.0 (468b1a5509403dd759917b137793f4482ffb4588)