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