Update README

This commit is contained in:
Michael Bull 2017-10-21 19:44:58 +01:00
parent 9acd99dffd
commit 9f64b5409a

View File

@ -12,16 +12,17 @@ Result monad is present, including:
- [Haskell](https://hackage.haskell.org/package/base-4.10.0.0/docs/Data-Either.html) - [Haskell](https://hackage.haskell.org/package/base-4.10.0.0/docs/Data-Either.html)
- [Rust](https://doc.rust-lang.org/std/result/) - [Rust](https://doc.rust-lang.org/std/result/)
It also iterates on other Result libraries written in kotlin, namely: It also iterates on other Result libraries written in Kotlin, namely:
- [`kotlin-result`](https://github.com/danneu/kotlin-result) - [danneu/kotlin-result](https://github.com/danneu/kotlin-result)
- [Result](https://github.com/kittinunf/Result) - [kittinunf/Result](https://github.com/kittinunf/Result)
Improvements on the existing solutions include: Improvements on the existing solutions include:
- Relaxed constraints on nullable types (both the `value` and `error` can be - Complete feature parity with Result types from other languages including Elm,
typed as nullable) Haskell, & Rust
- Relaxed constraints on the `error` type to not inherit from `Exception` - Lax constraints on `value`/`error` nullability
- Lax constraints on the `error` type's (does not inherit from `Exception`)
- Top level `Ok` and `Error` classes avoids qualifying usages with - Top level `Ok` and `Error` classes avoids qualifying usages with
`Result.Ok`/`Result.Error` respectively `Result.Ok`/`Result.Error` respectively
- Higher-order functions marked with the `inline` keyword for reduced runtime - Higher-order functions marked with the `inline` keyword for reduced runtime
@ -32,7 +33,6 @@ Improvements on the existing solutions include:
`unwrap`) `unwrap`)
- Extensive test suite with over 50 unit tests and every library method covered - Extensive test suite with over 50 unit tests and every library method covered
## Installation ## Installation
This project is available in the [Maven Central Repository][maven-central] This project is available in the [Maven Central Repository][maven-central]
@ -48,9 +48,24 @@ dependencies {
} }
``` ```
## Getting Started
The [unit tests][unit-tests] are a good source of examples for using the library
as they cover every avaiable method.
Mappings from common Result libraries are available on the [wiki][wiki]:
- [Elm][wiki-elm]
- [Haskell][wiki-haskell]
- [Rust][wiki-rust]
[Result]: https://github.com/michaelbull/kotlin-result/blob/master/src/main/kotlin/com/mikebull94/result/Result.kt#L8 [Result]: https://github.com/michaelbull/kotlin-result/blob/master/src/main/kotlin/com/mikebull94/result/Result.kt#L8
[Result.Ok]: https://github.com/michaelbull/kotlin-result/blob/master/src/main/kotlin/com/mikebull94/result/Result.kt#L13 [Result.Ok]: https://github.com/michaelbull/kotlin-result/blob/master/src/main/kotlin/com/mikebull94/result/Result.kt#L13
[Result.Error]: https://github.com/michaelbull/kotlin-result/blob/master/src/main/kotlin/com/mikebull94/result/Result.kt#L29a [Result.Error]: https://github.com/michaelbull/kotlin-result/blob/master/src/main/kotlin/com/mikebull94/result/Result.kt#L29a
[maven-central]: http://search.maven.org/ [maven-central]: http://search.maven.org/
[gpg]:https://www.michael-bull.com/gpg.asc [gpg]:https://www.michael-bull.com/gpg.asc
[unit-tests]: https://github.com/michaelbull/kotlin-result/tree/master/src/test/kotlin/com/mikebull94/result
[wiki]: https://github.com/michaelbull/kotlin-result/wiki
[wiki-elm]: https://github.com/michaelbull/kotlin-result/wiki/Elm
[wiki-haskell]: https://github.com/michaelbull/kotlin-result/wiki/Haskell
[wiki-rust]: https://github.com/michaelbull/kotlin-result/wiki/Rust