/** * Flat maps over the value type. * * @tsplus static effect/core/io/Exit.Aspects flatMap * @tsplus pipeable effect/core/io/Exit flatMap */ export function flatMap(f: (a: A) => Exit) { return (self: Exit): Exit => { switch (self._tag) { case "Failure": return self case "Success": return f(self.value) } } }