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

Method compose

packages/effect/src/Optic.ts:490–490  ·  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

488 * @see {@link id} — start a composition chain
489 */
490 compose<B>(this: Iso<S, A>, that: Iso<A, B>): Iso<S, B>
491 compose<B>(this: Lens<S, A>, that: Lens<A, B>): Lens<S, B>
492 compose<B>(this: Prism<S, A>, that: Prism<A, B>): Prism<S, B>
493 compose<B>(this: Optional<S, A>, that: Optional<A, B>): Optional<S, B>

Callers 15

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
FiberSet.tsFile · 0.65
FiberHandle.tsFile · 0.65
ArrayFunction · 0.65

Implementers 1

OptionalImplpackages/effect/src/Optic.ts

Calls

no outgoing calls

Tested by

no test coverage detected