From mboxrd@z Thu Jan 1 00:00:00 1970 Date: Wed, 15 Jul 2009 22:27:58 +0100 From: Ethan Grammatikidis To: 9fans@9fans.net Message-Id: <20090715222758.28371a78.eekee57@fastmail.fm> In-Reply-To: <3e1162e60907151351n1e88a15ue70da5cdd83317b4@mail.gmail.com> References: <7d3530220907151000s60671d2gfdb18cdf12c55097@mail.gmail.com> <0009e18319f5c60dc890463505286c1c@quintile.net> <3e1162e60907151159g5b031e99k2ad8171c9c268392@mail.gmail.com> <9ab217670907151314n4e5c5855oda60cc527bb83422@mail.gmail.com> <56a297000907151342x334e7793ubfedb791a62f2bd8@mail.gmail.com> <3e1162e60907151351n1e88a15ue70da5cdd83317b4@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [9fans] Why does Acme only show text? Topicbox-Message-UUID: 21fd23e4-ead5-11e9-9d60-3106f5b1d025 On Wed, 15 Jul 2009 13:51:02 -0700 David Leimbach wrote: > On Wed, Jul 15, 2009 at 1:42 PM, Noah Evans wrote: > > > http://9fans.net/archive/2008/05/6 > > > Haskell *will* tell you errors that don't make any sense (at least GHC > errors) when you don't have things like this done properly The linked post pointed out there are times when barely-visible errors are not caught and go on to cause big problems. That's pretty nasty. > > do x <- foo > y <- bar > > the y <- bar must be directly under the x on the previous line or it's a > syntax error, and the error you get from GHC is "the last statement of a do > construct must be an expression" Huh, so this Haskell syntax actually prevents you from indenting something that would be indented in any other language. Okay... > > Luckilly Haskell will let you ignore "layout" and do the following: > > do { x <- foo > ; y <- bar } > > However, I don't see enough of this style code to feel comfortable writing > anything I'd plan to share with anyone and expect them to feel ok reading > it. It sure doesn't look comfortable to me. Strange semicolon placement for one thing. Do the braces have to be on the same lines as the code like that? Could it be written like this?: do { x <- foo; y <- bar } That's readable to my eyes, but looks like it may be quite different to the first form. -- Ethan Grammatikidis Those who are slower at parsing information must necessarily be faster at problem-solving.