Skip to content

NonEmptyIListNestedOps<A>

extension NonEmptyIListNestedOps<A> on NonEmptyIList<NonEmptyIList<A>>

Operations available when NonEmptyIList elements are themselves NonEmptyILists.

Methods

flatten() extension

NonEmptyIList<A> flatten()

Combines all nested lists into one list using concatenation.

Available on NonEmptyIList<A>, provided by the NonEmptyIListNestedOps<A> extension

Implementation
dart
NonEmptyIList<A> flatten() => head.concat(_tail.flatMap((a) => a.toIList()));