Talk:Haskell/Indentation

Indentation of lists of statements
I for one appreciate this page, because it at least attempts to spell out the rules of "layout" without getting mired in the obtuse mechanics described in the Report. That said, I think the discussion of the indentation within a 'do', 'case' etc is a little loose:

"When starting a group inline, all expressions in the group have to be exactly aligned with the position of the first expression."

I didn't find any mention of a 'group' or 'group inline' in the 2010 Report. I think this sentence is probably referring to places where a statement has a _list_ of subsidiary statements or expressions (named differently for each situation: do has statements, case has alternatives, let and where have declarations).

So it might be good to point this out: that there are places where Haskell expects a list of somethings, and these should all be indented uniformly. This would mesh nicely with the explanation of why if-then-else can't be at the same indentation level within a do block. Er, I mean list of statements. Gwideman (discuss • contribs) 00:06, 4 March 2013 (UTC)

Exercises need answers
I think that the exercises are not very useful unless answers are provided, perhaps here on the talk page. Gwideman (discuss • contribs) 23:48, 3 March 2013 (UTC)
 * Exercises have solutions. There's a link the bottom of each chapter "solutions to exercises" Backfromquadrangle (discuss • contribs) 23:15, 5 December 2013 (UTC)
 * Cited from the soltution to the main exercice of this page: "for the moment I refuse". You call that a solution? To "explain" a badly formulated set of rules by a single exercice without solution is lamentable. Marc van Leeuwen (discuss • contribs) 07:09, 31 March 2014 (UTC)

No, exercises are awful and need to be replaced
It is unacceptable that there is no unsugared example with braces and semi-colons, and I am totally unconvinced about the value of absurd non-Haskell code. It's like asking people to read English by learning to handle technically pronounceable strings like "rostralmznowp". I'm removing the lousy exercise and adding a mark that something real is needed. Backfromquadrangle (discuss • contribs) 17:37, 30 April 2014 (UTC)

Related to the issue of braces and such, I do not understand the strange do-block with the unindented stuff below it. A much better explanation is needed there. Backfromquadrangle (discuss • contribs) 17:37, 30 April 2014 (UTC)

PDF conversion
This page does not carry over very well to the offered PDFs. Compare e.g. https://en.wikibooks.org/w/index.php?title=File%3AHaskell.pdf&page=161 where the "wrong, wrong, right" appear identical - linebreaks and indentation are missing. Not sure what would need to be done here to make the line breaks and indentation appear properly over there. \Mike (discuss • contribs) 23:18, 11 February 2014 (UTC)

Thanks for reporting the isse. It has been resolved today. --Dirk Hünniger (discuss • contribs) 11:42, 20 April 2014 (UTC)

" within " section outdated?
It mentions in the Exercise that there's a proposal to add optional semicolons, and that proposal seems (to me) to have been accepted in 2010. --72.226.86.106 (discuss) 02:26, 15 June 2015 (UTC)

This seems to be a good link about the proposal. Two questions to consider before rewriting this section are: Bsammon (discuss • contribs) 05:39, 16 July 2017 (UTC)
 * Is the book targeting Haskell 98 or Haskell 2010?
 * What is the likelyhood that members of the target audience for this book will run into Haskell compilers/interpreters that do not support the relaxed syntax?