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.