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

Function transposeOption

packages/effect/src/Effect.ts:13344–13348  ·  view source on GitHub ↗
(
  self: Option.Option<Effect<A, E, R>>
)

Source from the content-addressed store, hash-verified

13342 * @category Optional Wrapping & Unwrapping
13343 */
13344export const transposeOption = <A = never, E = never, R = never>(
13345 self: Option.Option<Effect<A, E, R>>
13346): Effect<Option.Option<A>, E, R> => {
13347 return option_.isNone(self) ? succeedNone : map(self.value, option_.some)
13348}
13349
13350/**
13351 * Applies an `Effect` on an `Option` and transposes the result.

Callers

nothing calls this directly

Calls 1

mapFunction · 0.70

Tested by

no test coverage detected