/** * Returns a new channel, which flattens the terminal value of this channel. * This function may only be called if the terminal value of this channel is * another channel of compatible types. * * @tsplus getter effect/core/stream/Channel flatten */ export function flatten< Env, InErr, InElem, InDone, OutErr, OutElem, Env1, InErr1, InElem1, InDone1, OutErr1, OutElem1, OutDone2 >( self: Channel< Env, InErr, InElem, InDone, OutErr, OutElem, Channel > ): Channel< Env | Env1, InErr & InErr1, InElem & InElem1, InDone & InDone1, OutErr | OutErr1, OutElem | OutElem1, OutDone2 > { return self.flatMap(identity) }