Skip to content

Commit

Permalink
⬆️ [New version] Release version 3.1.0 (#72)
Browse files Browse the repository at this point in the history
  • Loading branch information
kittinunf committed Aug 19, 2020
1 parent a4f08c5 commit 3f626af
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
10 changes: 4 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,16 @@
# Result

[![Kotlin](https://img.shields.io/badge/kotlin-1.3.30-blue.svg)](http://kotlinlang.org)
[![Kotlin](https://img.shields.io/badge/kotlin-1.4.0-blue.svg)](http://kotlinlang.org)
[![jcenter](https://api.bintray.com/packages/kittinunf/maven/Result/images/download.svg)](https://bintray.com/kittinunf/maven/Result/_latestVersion)
[![MavenCentral](https://maven-badges.herokuapp.com/maven-central/com.github.kittinunf.result/result/badge.svg)](https://search.maven.org/search?q=g:com.github.kittinunf.result)
[![Build Status](https://travis-ci.org/kittinunf/Result.svg?branch=master)](https://travis-ci.org/kittinunf/Result)
[![Codecov](https://codecov.io/github/kittinunf/Result/coverage.svg?branch=master)](https://codecov.io/gh/kittinunf/Result)

This is a tiny framework for modelling success/failure of operations in [Kotlin](http://kotlinlang.org). In short, it is a model in type of `Result<V, E : Exception>`.
This is a tiny framework for modelling success/failure of operations in [Kotlin](http://kotlinlang.org). In short, it is a model in type of `Result<V: Any?, E : Exception>`.

## Ideology

`Result<V, E: Exception>` is to provide higher abstraction of operation that can be ended with result either success or failure. The is somewhat similar to Kotlin's `nullable types` (`T?`) (https://kotlinlang.org/docs/reference/null-safety.html).

`Result.Success` represents `value` in case of success, and `Result.Failure` represents `error` in case of failure which is upper bounded with `Exception` type.
`Result<V: Any?, E: Exception>` is to provide higher abstraction of operation that can be ended with result either success or failure. `Result.Success` represents `value` in case of success, and `Result.Failure` represents `error` in case of failure which is upper bounded with `Exception` type.

## Installation

Expand Down Expand Up @@ -184,7 +182,7 @@ The creates a nice "happy path" of the whole chain, also handle error as appropr

## Never Fail Operation

In some case, one wants to model an always successful operation. `Result<V, NoException>` is a good idea for that.
In some case, one wants to model an always successful operation. `Result<V: Any?, NoException>` is a good idea for that.
`NoException` is to indicate that there is no exception to throw. E.g.

``` Kotlin
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@ artifactUrl=https://github.com/kittinunf/Result
artifactScm=git@github.com:kittinunf/result.git
artifactLicenseName=MIT License
artifactLicenseUrl=http://www.opensource.org/licenses/mit-license.php
artifactPublish=3.0.1
artifactPublish=3.1.0
artifactGroupId=com.github.kittinunf.result

0 comments on commit 3f626af

Please sign in to comment.