MCPcopy Create free account
hub / github.com/Effect-TS/effect / transposeOption

Function transposeOption

packages/effect/src/Result.ts:1707–1711  ·  view source on GitHub ↗
(
  self: Option<Result<A, E>>
)

Source from the content-addressed store, hash-verified

1705 * @since 3.14.0
1706 */
1707export const transposeOption = <A = never, E = never>(
1708 self: Option<Result<A, E>>
1709): Result<Option<A>, E> => {
1710 return option_.isNone(self) ? succeedNone : map(self.value, option_.some)
1711}
1712
1713/**
1714 * Maps an `Option` value with a `Result`-producing function, then transposes

Callers

nothing calls this directly

Calls 1

mapFunction · 0.85

Tested by

no test coverage detected