const isFailureSymbol = Symbol('isFailure');
/**
 * Helper to return a non failure result
 * @param result Result to return.
 */
export function Ok(result) {
    return result;
}
/**
 * Helper to return a {@link Fail} result.
 * @param failure The failure to return
 */
export function Fail(failure) {
    const tmp = failure;
    tmp[isFailureSymbol] = true;
    return tmp;
}
/**
 * Checks if a value is a {@link Failure} or not. A {@link Failure} is a value that was created
 * with the {@link Fail} function.
 * @param resultOrFailure value to check if it is a {@link Fail}'ure nor not.
 */
export function isFailure(resultOrFailure) {
    return resultOrFailure != null && resultOrFailure[isFailureSymbol] === true;
}
//# sourceMappingURL=fail.js.map