import { concreteTSet } from "@effect/core/stm/TSet/operations/_internal/InternalTSet" /** * Transactionally takes the first matching value, or retries until there is one. * * @tsplus static effect/core/stm/TSet.Aspects takeFirstSTM * @tsplus pipeable effect/core/stm/TSet takeFirstSTM */ export function takeFirstSTM(pf: (a: A) => STM, B>) { return (self: TSet): STM => { concreteTSet(self) return self.tmap.takeFirstSTM((kv) => pf(kv[0])) } }