core / pragma / PragmaResult / fold /
fold #
inline fun <TFoldResult> fold(onSuccess: (TSuccess) -> TFoldResult, onFailure: (TFailure) -> TFoldResult): TFoldResult
Returns the result of onSuccess for the encapsulated value if this instance represents success or the result of onFailure function for the encapsulated TFailure if it is failure.