/** * Feeds the error or output services of this layer into the input of either * the specified `failure` or `success` layers, resulting in a new layer with * the inputs of this layer, and the error or outputs of the specified layer. * * @tsplus static effect/core/io/Layer.Aspects foldLayer * @tsplus pipeable effect/core/io/Layer foldLayer */ export function foldLayer( failure: (e: E) => Layer, success: (a: Env) => Layer ) { return (self: Layer): Layer => self.foldCauseLayer( (cause) => cause.failureOrCause.fold(failure, (cause) => Layer.failCause(cause)), success ) }