MCPcopy
hub / github.com/Effect-TS/effect / permutation

Function permutation

packages/effect/test/STM.test.ts:143–154  ·  view source on GitHub ↗
(ref1: TRef.TRef<number>, ref2: TRef.TRef<number>)

Source from the content-addressed store, hash-verified

141 )
142
143const permutation = (ref1: TRef.TRef<number>, ref2: TRef.TRef<number>): STM.STM<void> =>
144 pipe(
145 STM.all([TRef.get(ref1), TRef.get(ref2)]),
146 STM.flatMap(([a, b]) =>
147 pipe(
148 ref1,
149 TRef.set(b),
150 STM.tap(() => pipe(ref2, TRef.set(a))),
151 STM.asVoid
152 )
153 )
154 )
155
156describe("STM", () => {
157 it.effect("catchAll", () =>

Callers 1

STM.test.tsFile · 0.85

Calls 3

pipeFunction · 0.90
getMethod · 0.65
setMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…