# filterMap

Refines and maps a matched value with an Option-returning function.

## Signatures

```ts
export declare const filterMap: {
    <O, B>(f: (o: O) => Option.Option<B>): <I, R, E>(guard: GuardInput<I, O, E, R>) => Guard<I, B, E, R>;
    <I, O, E, R, B>(guard: GuardInput<I, O, E, R>, f: (o: O) => Option.Option<B>): Guard<I, B, E, R>;
};
```

## Why

`Option.none` provides a second ordinary non-match stage without introducing typed failure.

## Ownership and lifetime

This combinator acquires no resources; the callback runs only for source matches.

## Examples

```ts
import { filterMap, liftPredicate } from "@typed/guard"
import { Option } from "effect"
const parsed = filterMap(liftPredicate((u: unknown): u is string => typeof u === "string"), (s) => s ? Option.some(Number(s)) : Option.none())
```
