I understand that a list actually contains values, and a sequence is an alias for IEnumerable<T>
. In practical F# development, when should I be using a sequence as opposed to a list?
Here's some reasons I can see when a sequence would be better:
- When interacting with other .NET languages or libraries that require
IEnumerable<T>
. - Need to represent an infinite sequence (probably not really useful in practice).
- Need lazy evaluation.
Are there any others?