List α is the type of ordered lists with elements of type α.
It is implemented as a linked list.
List α is isomorphic to Array α, but they are useful for different things:
-
List αis easier for reasoning, andArray αis modeled as a wrapper aroundList α -
List αworks well as a persistent data structure, when many copies of the tail are shared. When the value is not shared,Array αwill have better performance because it can do destructive updates.
Constructors
nil.{u} {α : Type u} : List α
[] is the empty list.