HamKrest

A Result type for Kotlin

Лицензия

Лицензия

Группа

Группа

com.natpryce
Идентификатор

Идентификатор

result4k
Последняя версия

Последняя версия

2.0.0
Дата

Дата

Тип

Тип

jar
Описание

Описание

HamKrest
A Result type for Kotlin
Ссылка на сайт

Ссылка на сайт

https://github.com/npryce/result4k
Система контроля версий

Система контроля версий

https://github.com/npryce/result4k

Скачать result4k

Как подключить последнюю версию

<!-- https://jarcasting.com/artifacts/com.natpryce/result4k/ -->
<dependency>
    <groupId>com.natpryce</groupId>
    <artifactId>result4k</artifactId>
    <version>2.0.0</version>
</dependency>
// https://jarcasting.com/artifacts/com.natpryce/result4k/
implementation 'com.natpryce:result4k:2.0.0'
// https://jarcasting.com/artifacts/com.natpryce/result4k/
implementation ("com.natpryce:result4k:2.0.0")
'com.natpryce:result4k:jar:2.0.0'
<dependency org="com.natpryce" name="result4k" rev="2.0.0">
  <artifact name="result4k" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.natpryce', module='result4k', version='2.0.0')
)
libraryDependencies += "com.natpryce" % "result4k" % "2.0.0"
[com.natpryce/result4k "2.0.0"]

Зависимости

test (3)

Идентификатор библиотеки Тип Версия
org.jetbrains.kotlin : kotlin-stdlib jar 1.1.51
org.jetbrains.kotlin : kotlin-test jar 1.1.51
junit : junit jar 4.12

Модули Проекта

Данный проект не имеет модулей.

Result4K

NB Result4K is moving - please migrate to https://github.com/fork-handles/forkhandles/tree/trunk/result4k

Kotlin Build Status Maven Central

Type safe error handling in Kotlin.

Motivation

Kotlin does not type-check exceptions. Result4k lets you type-check code that reports and recovers from errors.

A Result<T,E> represents the result of a calculation of a T value that might fail with an error of type E.

You can use a when expression to determine if a Result represents a success or a failure, but most of the time you don't need to. Result4k type provides many useful operations for handling success or failure without explicit conditionals.

Result4k works with the grain of the Kotlin language. Kotlin does not have language support for monads (known as "do notation" or "for comprehensions" in other languages). A pure monadic approach becomes verbose and awkward. Therefore, Result4k lets you use early returns to avoid deep nesting when propagating errors.

Версии библиотеки

Версия
2.0.0
1.4.1
1.4.0
1.3.0
1.2.0
1.1.0
1.0.0