map<A, B> function
- B f(
- A
Maps over the items of the NonEmptyList using function f
.
var nel = NonEmptyList([1, 2, 3]);
print(map<int, String>((i) => i.toString())(nel).items); // ["1", "2", "3"]
Implementation
NonEmptyList<B> Function(NonEmptyList<A>) map<A, B>(B Function(A) f) =>
(NonEmptyList<A> list) => NonEmptyList(list._items.map(f).toList());