[docs]@kindeddefflatten(container:KindN[_BindableKind,KindN[_BindableKind,_FirstType,_SecondType,_ThirdType],_SecondType,_ThirdType,],)->KindN[_BindableKind,_FirstType,_SecondType,_ThirdType]:""" Joins two nested containers together. Please, note that it will not join two ``Failure`` for ``Result`` case or two ``Nothing`` for ``Maybe`` case (or basically any two error types) together. .. code:: python >>> from returns.converters import flatten >>> from returns.io import IO >>> from returns.result import Failure, Success >>> assert flatten(IO(IO(1))) == IO(1) >>> assert flatten(Success(Success(1))) == Success(1) >>> assert flatten(Failure(Failure(1))) == Failure(Failure(1)) See also: - https://bit.ly/2sIviUr """returncontainer.bind(identity)