/** * Updates the value of the variable, returning a function of the specified * value. * * @tsplus static effect/core/stm/TRef.Aspects modifySome * @tsplus pipeable effect/core/stm/TRef modifySome */ export function modifySome(def: B, pf: (a: A) => Maybe) { return (self: TRef): STM => self.modify((a) => pf(a).getOrElse([def, a] as const)) }