418993 (2) [Avatar] Offline
#1
Hello,

I'm reading Chapter 1 of Elm_in_Action_v2_MEAP and I'm a bit confused about the question in the title. In my view, as List cannot be changed, why it has variable length then?
9821 (4) [Avatar] Offline
#2
A tuple's length is part of its type. If your function takes a (Int, Int) tuple then the only thing I can past to your function is two Ints. However if it takes a List of Ints then I can pass a List of any length to it.

It's also possible to add a new value in front of a list (yielding a new list) or concat two lists together (also yielding a new list) which is also impossible to do with tuples.
418993 (2) [Avatar] Offline
#3
"A tuple's length is part of its type." This makes sense. Thanks.