/** * Converts an option on values into an option on errors. * * @tsplus getter effect/core/stm/STM some */ export function some(self: STM>): STM, A> { return self.foldSTM( (e) => STM.fail(Maybe.some(e)), (option) => option.fold(STM.fail(Maybe.none), STM.succeed) ) }