# Fx.flatMapEffect

Maps each element of an Fx to an Effect, and merges the results.

## Signatures

```ts
export declare const flatMapEffect: FlatMapEffectLike;
```

## Why

This is the Effect-producing form of {@link flatMap }. It admits independent
Effects directly without callers manually applying `Fx.fromEffect`.

## Concurrency, ordering, and cardinality

Every source value starts one Effect with unbounded concurrency. Each
successful Effect emits exactly one value. Results appear in completion order,
not source order, and no output buffer restores ordering.

## Ownership and lifetime

Source and callback failures remain typed and callback services are unioned
with source services. The required `Scope` owns all running Effects; source
completion waits for them, and interruption runs every Effect finalizer.

## Examples

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

const loaded = Fx.flatMapEffect(Fx.fromIterable([
  { id: "slow", wait: "20 millis" as const },
  { id: "fast", wait: "1 millis" as const }
]), ({ id, wait }) => Effect.as(Effect.sleep(wait), id))

Effect.runPromise(Effect.scoped(Fx.collectAll(loaded))).then(console.log)
// ["fast", "slow"]
```
