Commit Graph

229 Commits

Author SHA1 Message Date
Michael Bull
d2723009df Simplify endpoints in example app 2018-01-11 19:27:07 +00:00
Michael Bull
76870ef78a Catch Exception instead of Throwable in Result.of 2018-01-11 18:31:10 +00:00
Michael Bull
cfaa57dd1f Add example application 2018-01-11 18:30:41 +00:00
Michael Bull
389a87ffe2 Simplify editorconfig 2018-01-11 18:29:29 +00:00
Michael Bull
c2fc72d0cb Add zip functions 2018-01-11 18:28:31 +00:00
Michael Bull
e06ee4e525 [Gradle Release Plugin] - new version commit: '1.0.7-SNAPSHOT'. 2018-01-10 17:44:49 +00:00
Michael Bull
0267d9fb2b [Gradle Release Plugin] - pre tag commit: '1.0.6'. 2018-01-10 17:44:41 +00:00
Michael Bull
7f6d41e2d0 Update README 2018-01-10 17:44:12 +00:00
Michael Bull
c5a11a914e Simplify doc comments according to Kotlin Coding Conventions
https://kotlinlang.org/docs/reference/coding-conventions.html#documentation-comments
2018-01-10 16:04:40 +00:00
Michael Bull
c6be93142d Add lazy variants for {and,or,getOr,getErrorOr} 2018-01-10 13:27:02 +00:00
Michael Bull
17f46f3826 [Gradle Release Plugin] - new version commit: '1.0.6-SNAPSHOT'. 2017-12-17 00:17:10 +00:00
Michael Bull
9127027e48 [Gradle Release Plugin] - pre tag commit: '1.0.5'. 2017-12-17 00:17:02 +00:00
Michael Bull
dc9f0cc421 Update README 2017-12-17 00:16:48 +00:00
Michael Bull
44a4467595 Alias flatMap function to andThen 2017-12-17 00:16:03 +00:00
Michael Bull
b2d29d62b7 Improve javadoc 2017-12-17 00:14:27 +00:00
Michael Bull
3ec5fd3b96 [Gradle Release Plugin] - new version commit: '1.0.5-SNAPSHOT'. 2017-12-16 22:37:00 +00:00
Michael Bull
1254f51418 [Gradle Release Plugin] - pre tag commit: '1.0.4'. 2017-12-16 22:36:53 +00:00
Michael Bull
0a5a14cf42 Update README 2017-12-16 22:34:06 +00:00
Michael Bull
3e3b649193 Mark on{Success,Failure} as infix 2017-12-16 22:30:04 +00:00
Michael Bull
5dc5d3680e
Merge pull request #3 from kevinherron/inline-on-functions
Inline the onSuccess() and onFailure() functions
2017-12-16 22:26:39 +00:00
Kevin Herron
47fa20ca34 Inline the onSuccess() and onFailure() functions 2017-12-16 14:12:07 -08:00
Michael Bull
80c6410181 [Gradle Release Plugin] - new version commit: '1.0.4-SNAPSHOT'. 2017-12-16 19:52:45 +00:00
Michael Bull
d3db9c1f30 [Gradle Release Plugin] - pre tag commit: '1.0.3'. 2017-12-16 19:52:37 +00:00
Michael Bull
7b5ffefa8f Downgrade dokka
Version 0.9.15 is producing an error on CI:
- Could not find org.jetbrains.dokka:integration:0.9.15.
2017-12-16 19:50:00 +00:00
Michael Bull
c198328059 Update version in README 2017-12-16 19:31:18 +00:00
Michael Bull
9ddac98e0c Add multi-platform support
Converts the unit tests to use kotlin-test, allowing them to target both
the jvm and js platforms.
2017-12-16 19:30:54 +00:00
Michael Bull
416c0950b2 Update kotlin to 1.2.10 2017-12-16 19:26:01 +00:00
Michael Bull
64213f4b04 Update Gradle to 4.4 2017-12-16 19:23:33 +00:00
Michael Bull
b5a78cde8e [Gradle Release Plugin] - new version commit: '1.0.3-SNAPSHOT'. 2017-11-28 18:47:54 +00:00
Michael Bull
eed6044179 [Gradle Release Plugin] - pre tag commit: '1.0.2'. 2017-11-28 18:47:46 +00:00
Michael Bull
8b13ab735c Update version in README 2017-11-28 18:47:15 +00:00
Michael Bull
7c8fca3053 Update Gradle to v4.3.1 2017-11-28 18:40:25 +00:00
Michael Bull
e455be2cc8 Make lambda return type of expect{Err} return Any
When constructing the exception message the toString method will be
implicitly called on the result of the lambda.

Takes inspiration from Kotlin's require function [1].

[1]: https://github.com/JetBrains/kotlin/blob/v1.2.0/libraries/stdlib/src/kotlin/util/Preconditions.kt#L26
2017-11-28 18:23:36 +00:00
Michael Bull
8e3597322a Update kotlin to 1.2.0 2017-11-28 18:07:24 +00:00
Michael Bull
3ad15e71fb Update version in README 2017-11-25 16:32:35 +00:00
Michael Bull
b513c09470 Suppress unreachable code warnings in MapTest
These are intentional and are necessary to identify broken behaviour in
future, therefore the warnings are redundant.
2017-11-22 23:41:32 +00:00
Michael Bull
4e22fe4f02 [Gradle Release Plugin] - new version commit: '1.0.2-SNAPSHOT'. 2017-11-22 23:26:43 +00:00
Michael Bull
ea8154d922 [Gradle Release Plugin] - pre tag commit: '1.0.1'. 2017-11-22 23:26:34 +00:00
Michael Bull
5d5195af9d Add getErrorOrElse
Matches getOrElse signature with respect to the error.
2017-11-22 23:25:28 +00:00
Michael Bull
ad7adacf39 Lazily evaluate message argument in expect/expectError 2017-11-22 23:25:28 +00:00
Michael Bull
02de42f959 Correct version number in README 2017-10-25 17:10:19 +01:00
Michael Bull
474fd0b903 [Gradle Release Plugin] - new version commit: '1.0.1-SNAPSHOT'. 2017-10-22 16:56:38 +01:00
Michael Bull
3a71508531 [Gradle Release Plugin] - pre tag commit: '1.0.0'. 2017-10-22 16:09:57 +01:00
Michael Bull
af13c9ee7c Rename Error class to Err
Avoids naming conflict with the stdlib's Error class, also now matches
Rust's naming.
2017-10-22 16:08:26 +01:00
Michael Bull
43128cf1cc Update version number on README 2017-10-22 16:07:24 +01:00
Michael Bull
1933c9f845 Use filterIsInstance in getAll methods 2017-10-22 16:07:24 +01:00
Michael Bull
7be628e79e Add unit tests for Result.of 2017-10-22 16:07:24 +01:00
Michael Bull
9960bc78aa List result4k under inspirations in README 2017-10-22 16:07:24 +01:00
Michael Bull
f0fb536516 Add Result.of factory method
Inspired by result4k, invokes a callback within a try/catch block,
returning an Error if an exception was thrown and Ok otherwise.
2017-10-22 16:07:24 +01:00
Michael Bull
dc4101b8ef Remove factory methods and expose Ok/Error constructors
Also converts them to data classes.
2017-10-22 16:07:24 +01:00