Talk:Haskell/YAHT/Type basics
From Wikibooks, the open-content textbooks collection
ISSUE: The pronunciation of Boolean is correctly given; then, a statement is made that an alternative pronunciation has been heard.
PROBLEM: Simply because one has "heard" an improper pronunciation does not mean that one should adopt the incorrect pronunciation.
ANALOGY: Let's concentrate on base 10 arithmetic. In that system, 2 + 2 = 4 (but -- once or twice -- I've also seen that 2 + 2 = 5)
DISCUSSION: As a tutor, one need not (and I would stress that one SHOULD not) confuse a student by introducing erroneous alternatives. The fact that I may have seen (perhaps when correcting homework of another student) the answer to our equation given as "5" instead of "4" does not reasonably obligate me (as a tutor) to share what I know to be incorrect information.
[edit] Either/left/right exercise very unclear
I don't think you're giving the student enough information to know how to do the exercise where you want either a value, a pair, a triple, etc back. Looking at the solution doesn't help either (it also doesn't help in the PDF that the solution goes off to the right and you can't see it all).
It says something about how you will need to use the Either type to represent it, but you don't have to directly mention Either (unless you are entering the function's type signature), but you do have to somehow guess that every time you use alternation, you get something that is addressable with Left and Right. Nothing in the text prepares the reader for this. Either is introduced earlier as "another useful type", not something that is going to automatically apply every time I define a type with the | symbol. Is that what the | symbol means? That I'm using Either? I don't get it.
Msouth 18:41, 17 July 2007 (UTC)
- I agree, and I've fixed the problem.
- MichaelPloujnikov (talk) 20:07, 13 October 2008 (UTC)
[edit] How do I display my type?
I'm brand new to haskell, and after reading this page and the "advanced type" page, I can't figure out how to tell GHCI to display my new type.
How do I make my new data type a member of class Show?