Talk:Haskell/Lists and tuples

DavidHouse: oops! Sorry about those edit conflicts! Don't think I'll have much time for wikibook hacking. Over to you. -- Kowey 18:05, 25 July 2006 (UTC)

Dupes
Is the List section supposed to summarize or duplicate Haskell/Lists or what? I'm just confused. --maru (talk) contribs 23:38, 1 October 2006 (UTC)


 * DavidHouse and I were rearranging things. Haskell/Lists should probably be renamed to something like Haskell/More on lists. This page is meant to be very introductory; give the reader the bare list and tuple essentials for learning the other stuff.  -- Kowey 08:48, 2 October 2006 (UTC)

FIXME: Is this too hard?
I'm not sure what you meant by that comment. Coming up with the answer "You can't just add on to a tuple because it has a size restraint" is trivial. Coming up with a more in-depth answer doesn't seem feasible to me, as a programming novice, without more information than covered so far.

-Humble Reader, 10/04/06 10:58 pm

consistent form for describing operators?
The comma operator is mentioned with double quotes around the comma, and the cons operator is written with parentheses. It might be nice for them to be done in bold, so I can tell if the is textually parenthesizing of if the parentheses are part of the formal definition, and whether the comma operator is formally defined with or without parens. Msouth 14:53, 15 July 2007 (UTC)

cons8 exercise: write a function that takes a list? how?
Am I supposed to know how to write a function that "takes a list"? I tried to figure out how to tell my function to expect a list, didn't know how to do it. It might be easier for people to guess what to do if you just said "write a function cons8 that takes a single argument and conses 8 on to it" or something like that. Msouth 15:12, 15 July 2007 (UTC)

lists - we should introduce ++ before :
How about introducing ++ before :? It would be easier to understand as it's commutative. We would need to give examples such as
 * [someThing]++someListofThings

The : should be mentioned last, only after it's clear what lists are, and how they must have elements of the same type. I think the list of lists example should be mentioned before : also. Concatenation of lists is easier to understand then is cons. Aaron McDaid (talk) 23:08, 5 January 2008 (UTC)


 * Especially given that operator ++ is needed to solve exercise 3. --2A02:8433:3580:3D00:5635:30FF:FEA8:D0B6 (discuss) 08:29, 19 July 2015 (UTC)


 * is introduced first because it is more fundamental and important to understand what lists are made of. Furthermore, prioritising  can induce newcomers to use it in situations where   would be enough, which is poor style and can lead to performance woes. The exercise 3 you mention is pedagogically a little risky in that respect already; talking about   first would make it worse.--Duplode (discuss • contribs) 14:55, 19 July 2015 (UTC)

Pattern matching already?
I don't think this including pattern matching to show how the fst function works is actually useful to people if they don't know what it is; we shouldn't show things that have not yet been covered. --Digichoron (discuss • contribs) 19:22, 4 April 2011 (UTC)


 * Attacked the issue by removing the forward reference and adding a proper introductory example to the Recursion chapter (and, as a side effect, bringing head and tail into play here). --Duplode (discuss • contribs) 07:53, 2 April 2012 (UTC)

Request amendment of discussion of length function
This is the input and output on my (latest stable) version of ghci:

length :: Foldable t => t a -> Int

Miroslav65 (discuss • contribs) 03:07, 12 November 2015 (UTC)


 * Thanks for pointing it out. GHC 7.10 has generalised the type of  and several other functions, so that they can be used not only with lists but also with some other structures. I won't make the amendment right now, as there are some other places in the book which also need to be adjusted and we'd rather do that in a coordinated way, but it is definitely in the plans.--Duplode (discuss • contribs) 19:04, 12 November 2015 (UTC)


 * I finally got around to fixing this passage. The example here was changed to use  rather than  ; as for , it is now used as a motivating example to make a preliminary remark about   in Haskell/Type basics II. I'm not too sure about how well that will work, but at least it reflects the current state of affairs. Cheers, Duplode (discuss • contribs) 02:59, 10 December 2016 (UTC)

Minor Typographic Edit of Notes Requested
In the notes section, Note 1 says "In some way cases they can be annoying." I'd change that to either "In some ways" or "In some cases," but I'm not familiar enough with Wikibooks editing to find the Notes section, so FYI. Miroslav65 (discuss • contribs) 06:16, 12 November 2015 (UTC)


 * Fixed. In such cases, the text of the footnotes is within the paragraph they are linked from, inside tags.--Duplode (discuss • contribs) 18:54, 12 November 2015 (UTC)

Update GHCi output?
GHCi error messages have changed somewhat from the ones given. In GHCi 7.8.4

instead of the given

But this should probably be changed generally.

Android B780 (discuss • contribs) 13:13, 30 December 2016 (UTC)


 * It would be nice to change them, specially given that some of the messages have improved. There aren't that many error messages across the book, so updating them all in a single pass shouldn't be too much trouble; I will look into that later.


 * (By the way, thanks for the correction at Type Basics II. Without it, I would have taken much longer to notice that the same edits that introduced that typo left a few other things needing to be adjusted around that point of the text.)


 * Cheers, Duplode (discuss • contribs) 04:26, 3 January 2017 (UTC)