logo
byethrow
Guide
API Reference
Guide
API Reference
logo
byethrow
@praha/byethrow

Modules

Result

Types

Type Alias: Failure<E>
Type Alias: InferFailure<T>
Type Alias: InferSuccess<T>
Type Alias: Result<T, E>
Type Alias: ResultAsync<T, E>
Type Alias: ResultFor<R, T, E>
Type Alias: ResultMaybeAsync<T, E>
Type Alias: Success<T>

Functions

Function: andThen()
Function: andThrough()
Function: assertFailure()
Function: assertSuccess()
Function: bind()
Function: combine()
Function: do()
Function: fail()
Function: inspect()
Function: inspectError()
Function: isFailure()
Function: isResult()
Function: isSuccess()
Function: map()
Function: mapError()
Function: orElse()
Function: parse()
Function: pipe()
Function: succeed()
Function: try()
Function: unwrap()
Function: unwrapError()

#Type Alias: Success<T>

Success<T> = object

Defined in: result.ts:22

Represents a successful result.

#Example

import { Result } from '@praha/byethrow';

const success: Result.Success<number> = {
  type: 'Success',
  value: 42,
};

#Type Parameters

#T

T

The type of the successful value.

#Properties

#type

readonly type: "Success"

Defined in: result.ts:23


#value

readonly value: T

Defined in: result.ts:24

Last Updated:

Previous PageType Alias: ResultMaybeAsync\<T, E\>
Next PageFunction: andThen()