/** * Finds all the key/value pairs matching the specified predicate, and uses * the provided effectful function to extract values out of them.. * * @tsplus static effect/core/stm/TMap.Aspects findAllSTM * @tsplus pipeable effect/core/stm/TMap findAllSTM */ export function findAllSTM( pf: (kv: readonly [K, V]) => STM, A> ) { return (self: TMap): STM> => self.foldSTM( Chunk.empty(), (acc, kv) => pf(kv).foldSTM((_) => _.fold(STM.succeed(acc), (e) => STM.fail(e)), (a) => STM.succeed(acc.append(a))) ) }