MCPcopy Index your code
hub / github.com/Effect-TS/effect / withState

Function withState

packages/effect/src/internal/stm/tRandom.ts:41–46  ·  view source on GitHub ↗
(
  state: TRef.TRef<Random.PCGRandomState>,
  f: (state: Random.PCGRandomState) => [A, Random.PCGRandomState]
)

Source from the content-addressed store, hash-verified

39}
40
41const withState = <A>(
42 state: TRef.TRef<Random.PCGRandomState>,
43 f: (state: Random.PCGRandomState) => [A, Random.PCGRandomState]
44): STM.STM<A> => {
45 return pipe(state, tRef.modify(f))
46}
47
48const shuffleWith = <A>(
49 iterable: Iterable<A>,

Callers 2

constructorMethod · 0.85
nextIntBetweenMethod · 0.85

Calls 2

modifyMethod · 0.65
pipeFunction · 0.50

Tested by

no test coverage detected