Talk:Haskell/Solutions/Lists and tuples

Answer to 3.1. in section "A different notion of many" could use some work
3. ''Lists can be built by consing new elements onto them: you cons a number onto a list of numbers, and get back a list of numbers. It turns out that there is no such way to build up tuples.''
 * 1) Why do you think that is?

the reason given is ambigous and doesn't really explain why. i can think of some potentially better answers. they may not be correct; i'm using this wikibook to learn about haskell myself.


 * there is no cons for tuples because they are immutable.
 * since tuples are immutable, they would need to be copied each time they were added to, which would be computationally expensive for large tuples in an inner loop.


 * why are they immutable?
 * perhaps the language creators wanted to limit the functionality of tuples to discourage their overuse. functions fed consable tuples instead of lists and tuples would likely need to be more complex, making them harder to read, write and maintain.

-- Sudozero (discuss • contribs) 05:12, 28 June 2014 (UTC) (Edited)


 * I've updated the answer with text similar to the last bullet point above. (done) -- Sudozero (discuss • contribs) 22:36, 30 June 2014 (UTC)