result
/
com.alliander.result
Package com.
alliander.
result
Types
Functions
Types
Failure
Link copied to clipboard
data class
Failure
<
Error
,
Value
>(error:
Error
) :
Result
<
Error
,
Value
>
Content copied to clipboard
A failed result of a computation
Result
Link copied to clipboard
sealed class
Result
<
Error
,
Value
>
Content copied to clipboard
Return type of a computation that could fail.
Success
Link copied to clipboard
data class
Success
<
Error
,
Value
>(data:
Value
) :
Result
<
Error
,
Value
>
Content copied to clipboard
A successful result of a computation.
Functions
map2
Link copied to clipboard
fun <
E
,
U
,
V
,
W
>
map2
(left:
Result
<
E
,
U
>, right:
Result
<
E
,
V
>, transform: (
U
,
V
) ->
W
):
Result
<
E
,
W
>
Content copied to clipboard
Map over two results.
map3
Link copied to clipboard
fun <
E
,
U
,
V
,
W
,
X
>
map3
(left:
Result
<
E
,
U
>, middle:
Result
<
E
,
V
>, right:
Result
<
E
,
W
>, transform: (
U
,
V
,
W
) ->
X
):
Result
<
E
,
X
>
Content copied to clipboard
Map over three results.
toResult
Link copied to clipboard
inline fun <
T
>
T
?.
toResult
():
Result
<
Unit
,
T
>
Content copied to clipboard
Turn a nullable type into a Result.