> For AI agents: the complete documentation index is available at /byethrow/llms.txt, the full documentation bundle is available at /byethrow/llms-full.txt.

# Function: isFailure()

> **isFailure**\<`R`>(`result`): `result is Extract<R, { type: "Failure" }>`

Type guard to check if a [Result](/byethrow/api/types/Result.Result.md) is a [Failure](/byethrow/api/types/Result.Failure.md).

## Type Parameters

### R

`R` _extends_ [`Result`](/byethrow/api/types/Result.Result.md)\<`unknown`, `unknown`>

The type of the result to check.

## Parameters

### result

`R`

The [Result](/byethrow/api/types/Result.Result.md) to check.

## Returns

`result is Extract<R, { type: "Failure" }>`

`true` if the result is a [Failure](/byethrow/api/types/Result.Failure.md), otherwise `false`.

## Example

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

const result: Result.Result<number, string> = { type: 'Failure', error: 'Something went wrong' };
if (Result.isFailure(result)) {
  console.error(result.error); // Safe access to error
}
```
