A result that may be either synchronous or asynchronous.
The type of the Success value.
The type of the Failure value.
import { Result } from '@praha/byethrow';const result: Result.ResultMaybeAsync<number, string> = { type: 'Success', value: 10 }; Copy
import { Result } from '@praha/byethrow';const result: Result.ResultMaybeAsync<number, string> = { type: 'Success', value: 10 };
import { Result } from '@praha/byethrow';const result: Result.ResultMaybeAsync<number, string> = Promise.resolve({ type: 'Failure', error: 'error' }); Copy
import { Result } from '@praha/byethrow';const result: Result.ResultMaybeAsync<number, string> = Promise.resolve({ type: 'Failure', error: 'error' });
A result that may be either synchronous or asynchronous.