Closed Mafii closed 1 year ago
First of all: This would be a breaking change, so if we wanted to do this, we'd have to wait for Funcky 4.0.
The point of materialize is to ... well ... materialize, so for instance for a Set<T>
you will get the set back as-is even though a set is not a list. Materialize focuses on the lowest common denominator which is IReadOnlyCollection<T>
[^1].
I suggest we implement your proposal as a separate method instead (something like MaterializeAsList
) if we have enough use cases for it.
[^1]: That's of course only partially true because ICollection<T>
doesn't inherit from IReadOnlyCollection<T>
🙃
This may be controversial, but it has an advantage:
Currently, list patterns can't be used with IReadOnlyCollection, which is a bummer. With IReadOnlyList that would work.