Commit Graph

60 Commits

Author SHA1 Message Date
Michael Bull
0b21b7361f Replace lateinit with null in binding variants 2024-03-11 00:06:46 +00:00
YuitoSato
716109aa84 Return List of errors for all variants of zipOrAccumulate
The four-arg and five-arg variants were returning Collection instead of
List.
2024-03-10 15:02:41 +00:00
Michael Bull
c46a2925b1 Add transpose
See: https://doc.rust-lang.org/std/result/enum.Result.html#method.transpose
2024-03-09 00:22:51 +00:00
Michael Bull
aca9ad92f8 Deprecate get{All,AllErrors} in favour of filter{Values,Errors} 2024-03-08 23:55:47 +00:00
Michael Bull
f091f507d9 Add Iterable#{filterValues,filterValuesTo,filterErrors,filterErrorsTo} 2024-03-08 23:55:47 +00:00
Michael Bull
6e62d9f97d Add Iterable#{allOk,allErr,anyOk,anyErr,countOk,countErr} 2024-03-08 23:40:07 +00:00
Michael Bull
15fc1ff013 Add mapCatching
See: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/map-catching.html
2024-03-08 20:42:44 +00:00
Michael Bull
f208f5ee79 Simplify predicate-based functions 2024-03-08 20:36:09 +00:00
Michael Bull
0b85cc2aad Reuse runCatching in recoverCatching 2024-03-08 20:29:41 +00:00
Michael Bull
d2932de547 Reformat Iterable 2024-03-08 14:46:59 +00:00
Michael Bull
01c8c00f98 Rename error to result in binding impls 2024-03-08 14:46:59 +00:00
Michael Bull
5c4635b655 Reformat project 2024-03-08 14:46:59 +00:00
Michael Bull
104f6a8ecd Mark objects as data objects in tests 2024-03-08 14:46:59 +00:00
Michael Bull
d8ea6e1c04 Move binding type declarations to lefthand of callsite 2024-03-08 14:46:59 +00:00
Michael Bull
f7c9f605f1 Tidy up MapTest 2024-03-08 14:46:59 +00:00
Michael Bull
f05ce6e0c7 Improve consistency across unit tests 2024-03-08 14:46:59 +00:00
Michael Bull
4e5cdeede7 Add flatMap{Both,Either} 2024-03-08 14:46:59 +00:00
Michael Bull
da96ceef8e Add more build targets for coroutines extensions
kotlinx-coroutines has since started publishing more native build
targets since we first became multiplatform. This commit ensures we also
build native targets for the platforms that were previously missing,
namely:

- androidNativeArm32
- androidNativeArm64
- androidNativeX64
- androidNativeX86
- linuxArm64
- wasmJs

This ensures that we are now supporting all three tiers of Kotlin/Native
target support.

See: https://kotlinlang.org/docs/native-target-support.html
2024-03-03 15:24:15 +00:00
Michael Bull
c3d28ed771 Simplify configuration of KotlinNpmInstallTask 2024-03-03 14:24:20 +00:00
Michael Bull
34cb35ffd5 Use import in build.gradle.kts 2024-03-03 01:42:25 +00:00
Michael Bull
88e31cd1ac Extract shared build logic to convention plugins
See: https://docs.gradle.org/current/userguide/sharing_build_logic_between_subprojects.html#sec:convention_plugins
2024-03-03 00:02:54 +00:00
Michael Bull
3f1dc0a2c7 Fix yaml indentation in editorconfig 2024-03-02 18:13:29 +00:00
Michael Bull
5ded43d3b4 Add flatten
Converts from Result<Result<V, E>, E> to Result<V, E>

See: https://doc.rust-lang.org/std/result/enum.Result.html#method.flatten
2024-03-02 16:51:45 +00:00
Michael Bull
73a71154e9 Add Rust reference comments for on{Success,Failure} 2024-03-02 16:39:14 +00:00
Michael Bull
05d50b7fec Facilitate mapping to arbitrary types in and/or functions
Closes #95
2024-03-02 16:36:56 +00:00
Michael Bull
54b53d36e6 Extract recover functions to separate file 2024-02-06 13:29:05 +00:00
Dmitry Bock
d4414b1a08 Add andThen{Recover,RecoverIf,RecoverUnless} 2024-02-06 11:40:46 +00:00
Michael Bull
05a1e91298 Update Kotlin to 1.9.20
Adopts the new default project template[1] and removed mpp targets[2].

[1] https://kotlinlang.org/docs/whatsnew1920.html#template-for-configuring-multiplatform-projects
[2] https://kotlinlang.org/docs/whatsnew1920.html#change-to-our-target-tiers-policy

See: https://kotl.in/native-targets-tiers
2024-01-23 13:14:37 +00:00
YuitoSato
27f0a63847 Add zipOrAccumulate
Closes #89, closes #90
2023-11-28 14:09:54 +00:00
Peter Cunderlik
e81f581436 Document the order of output lists in Iterable.kt
Closes #91
2023-10-11 15:14:18 +01:00
Kirill Zhukov
d7dbf35bcf Improve type constraint on toErrorIfNull
Closes #84 and closes #86
2023-05-23 10:09:20 +01:00
Michael Bull
fd2160c7a6 Add toErrorIfNull & toErrorUnlessNull
Closes #84
2023-04-03 14:05:36 +01:00
Michael Bull
8229a29f62 Update Gradle to 8.0.2 2023-04-03 12:16:37 +01:00
Matthew Nelson
6f86d20d53 Add more multiplatform build targets
Closes #77, #81
2023-01-09 10:57:12 +00:00
berik
a6eb86da71 Add recoverCatching
recoverCatching tries to recover, exceptions in transformation cause an error result.
2022-08-28 16:42:09 +01:00
Dmitry Suzdalev
fe30193d7c Add iosSimulatorArm64 and macosArm64 targets
Closes #71
2022-02-08 17:34:15 +02:00
Sebastian Kappen
d07bd589ed Add getOrThrow
Closes #68
2022-01-08 12:17:37 +00:00
Joseph Cooper
2667273015 Add runSuspendCatching and T#runSuspendCatching
Closes #67
2021-10-27 15:53:11 +01:00
Michael Bull
6080f3f190 Fix typo in throwIf/throwUnless kdoc
Missed the word "returns".
2021-10-26 17:09:58 +01:00
Joseph Cooper
3b87373b23 Add Result#{throwIf,throwUnless}
Closes #64, #66
2021-10-26 15:54:28 +01:00
Michael Bull
f236e2674b Add Result#orElseThrow 2021-10-26 15:51:56 +01:00
Michael Bull
419927f098 Suppress warning in GetTest 2021-10-26 12:32:01 +01:00
Joseph Cooper
4e1bb9d8de Replace usages of useExperimentalAnnotation
Fix warnings on kotlin-result/build.gradle.kts and
kotlin-result-coroutines/build.gradle.kts caused by using deprecated
useExperimentalAnnotation function.
2021-10-12 08:32:42 +01:00
Mathias Guelton
32b1a9edb6 Fix typo in mapOr KDoc 2021-06-12 15:46:05 +01:00
Avently
c4c70b4d98 Add Linux, Windows and MacOS targets 2021-03-29 18:41:20 +01:00
Tristan Hamilton
0df4c62d4f Move benchmarks to separate subproject 2021-02-10 22:07:29 +00:00
Tristan Hamilton
ccb9c5b3aa Add iOS build targets 2021-02-10 15:45:16 +00:00
Michael Bull
754aa5aaa4 Fix typo in recoverUnless kdoc 2021-02-07 13:32:51 +00:00
Jan Müller
0f90bb8b90
Add JS targets for Kotlin Multiplatform (#36) 2020-11-29 21:34:08 +00:00
Thomas Stenberg Oddsund
0fdd0f2c2b Add recoverIf and recoverUnless
These are similar to [toErrorIf] and [toErrorUnless], but maps from Err to Ok.
2020-11-28 22:50:52 +00:00