# Fx.catchTag

Recovers selected tagged typed failures by running a fallback Fx.

## Signatures

```ts
export declare const catchTag: {
    <const K extends Tags<E> | Arr.NonEmptyReadonlyArray<Tags<E>>, E, A2, E2, R2>(k: K, f: (e: ExtractTag<NoInfer<E>, K extends Arr.NonEmptyReadonlyArray<string> ? K[number] : K>) => Fx<A2, E2, R2>): <A, R>(self: Fx<A, E, R>) => Fx<A | A2, E2 | ExcludeTag<E, K extends Arr.NonEmptyReadonlyArray<string> ? K[number] : K>, R | R2>;
    <A, E, R, const K extends Tags<E> | Arr.NonEmptyReadonlyArray<Tags<E>>, A2, E2, R2>(self: Fx<A, E, R>, k: K, f: (e: ExtractTag<E, K extends Arr.NonEmptyReadonlyArray<string> ? K[number] : K>) => Fx<A2, E2, R2>): Fx<A | A2, E2 | ExcludeTag<E, K extends Arr.NonEmptyReadonlyArray<string> ? K[number] : K>, R | R2>;
};
```

## Why

Tagged error unions are idiomatic Effect APIs. Selecting one or more tags
narrows the handler input and removes only those variants from the returned
error channel, preserving the rest for later composition.

## Ownership and lifetime

The source owns the subscription until its Cause contains a Fail whose tag
matches. That first matching Fail starts one handler Fx and replaces the
entire original Cause, including any defects or interrupts composed with it.
A Cause with no Fail, or a first Fail with another tag, passes through intact.
The fallback is lazy and contributes its errors and services to the result.

## Examples

```ts
import { catchTag } from "@typed/fx/Fx"
import { fail, succeed } from "@typed/fx/Fx"

type Missing = { readonly _tag: "Missing"; readonly id: string }
const source = fail<Missing>({ _tag: "Missing", id: "42" })
const recovered = catchTag(source, "Missing", ({ id }) => succeed(`missing:${id}`))
```
