# Fx.concatMap

Maps each element to an inner Fx and concatenates the results sequentially.

## Signatures

```ts
export declare const concatMap: FlatMapLike;
```

## Why

`concatMap` is the flattening policy for work that must not overlap: the next
source value is admitted only after the current inner Fx completes. It is the
bounded-concurrency form of {@link flatMapConcurrently } with a limit of one.

## Ordering and cardinality

Every source value creates exactly one inner Fx. Inner values retain both
source order and their order within each inner Fx; no inner value is buffered
behind a later inner because later inners have not started yet.

## Ownership and lifetime

Source and inner failures are forwarded to the output Sink, and both service
requirements remain in the returned type. The required `Scope` owns the
admitted inner fiber; interruption closes it and prevents queued source work
from starting. No values are dropped, switched, or replayed.

## Examples

```ts
import { Fx } from "@typed/fx"
import { Effect } from "effect"

const ordered = Fx.concatMap(Fx.fromIterable([
  { id: "first", wait: "20 millis" as const },
  { id: "second", wait: "1 millis" as const }
]), ({ id, wait }) => Fx.at(id, wait))

const program = Effect.scoped(Fx.collectAll(ordered))
Effect.runPromise(program).then(console.log)
// ["first", "second"]: the one-millisecond inner is not started early
```
