Evan Martin (evan) wrote in evan_tech,
Evan Martin


Section 2.7 of the Haskell report (bottom of here) talks about their "layout". (See the very bottom for an example.)

This is neat. The language is defined with braces and semicolons. But:
Haskell permits the omission of the braces and semicolons used in several grammar productions, by using layout to convey the same information. This allows both layout-sensitive and layout-insensitive styles of coding, which can be freely mixed within one program. Because layout is not required, Haskell programs can be straightforwardly produced by other programs.

I remember the first time I tried to embed Python into a web page and I realized I had to figure out how to make the whitespace work out so my if statements would work. Haskell's system allows really simple and good-looking code for the common case (I don't think I've ever seen a curly brace in any Haskell code) but still can be defined as whitespace-insensitive.

By the way, Haskell code is totally hot. Even though I still can't figure out how to use it.
(Cut 'cause I'm afraid I'm posting too much.)

  • blog moved

    As described elsewhere, I've quit LiveJournal. If you're interested in my continuing posts, you should look at one of these (each contains feed…

  • dremel

    They published a paper on Dremel, my favorite previously-unpublished tool from the Google toolchest. Greg Linden discusses it: "[...] it is capable…

  • treemaps

    I finally wrote up my recent adventures in treemapping, complete with nifty clickable visualizations.

  • Post a new comment


    default userpic
    When you submit the form an invisible reCAPTCHA check will be performed.
    You must follow the Privacy Policy and Google Terms of use.