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

Method compose

packages/effect/src/Optic.ts:480–480  ·  view source on GitHub ↗

* Composes this optic with another. The result type is the weakest of * the two: Iso + Iso = Iso, Lens + Prism = Optional, etc. * * **Example** (Composing a lens with a prism) * * ```ts import.meta.vitest * import { Optic, Option, Result } from "effect" * * type State = { val

(this: Iso<S, A>, that: Iso<A, B>)

Source from the content-addressed store, hash-verified

478 * @see {@link id} — start a composition chain
479 */
480 compose<B>(this: Iso<S, A>, that: Iso<A, B>): Iso<S, B>
481 compose<B>(this: Lens<S, A>, that: Lens<A, B>): Lens<S, B>
482 compose<B>(this: Prism<S, A>, that: Prism<A, B>): Prism<S, B>
483 compose<B>(this: Optional<S, A>, that: Optional<A, B>): Optional<S, B>

Callers 14

Graph.tst.tsFile · 0.65
Predicate.tst.tsFile · 0.65
Optic.tst.tsFile · 0.65
Optic.test.tsFile · 0.65
Graph.test.tsFile · 0.65
Predicate.test.tsFile · 0.65
Function.test.tsFile · 0.65
Schema.test.tsFile · 0.65
FiberSet.tsFile · 0.65
FiberHandle.tsFile · 0.65
RecordFunction · 0.65
ArrayConfigFunction · 0.65

Implementers 1

OptionalImplpackages/effect/src/Optic.ts

Calls

no outgoing calls

Tested by

no test coverage detected