# tap

Runs a synchronous or Effectful observation for each matched value and returns the value unchanged.

## Signatures

```ts
export declare const tap: {
    <O>(f: (o: O) => void): <I, R, E>(guard: GuardInput<I, O, E, R>) => Guard<I, O, E, R>;
    <O, B, E2, R2>(f: (o: O) => Effect.Effect<B, E2, R2>): <I, R, E>(guard: GuardInput<I, O, E, R>) => Guard<I, O, E | E2, R | R2>;
    <I, O, E, R>(guard: GuardInput<I, O, E, R>, f: (o: O) => void): Guard<I, O, E, R>;
    <I, O, E, R, B, E2, R2>(guard: GuardInput<I, O, E, R>, f: (o: O) => Effect.Effect<B, E2, R2>): Guard<I, O, E | E2, R | R2>;
};
```

## Why

Observation composes without changing output, while Effect callbacks correctly contribute their errors and services.

## Ownership and lifetime

Construction acquires no resources; callback lifetime is bounded by each matching Guard invocation.

## Examples

```ts
import { liftPredicate, tap } from "@typed/guard"
const observed = tap(liftPredicate((u: unknown): u is string => typeof u === "string"), console.log)
```
