[Haskell-cafe] A wish for relaxed layout syntax

Steve Schafer steve at fenestra.com
Wed Mar 28 16:52:31 EDT 2007


On Wed, 28 Mar 2007 22:21:08 +0200, you wrote:

>I often run into the following issue: I want to write a list of lengthy
>items like this
>
>mylist = [
>  quite_lengthy_list_item_number_one,
>  quite_lengthy_list_item_number_two,
>  quite_lengthy_list_item_number_three
>]

I suspect that I'm in a small minority, but I prefer this:

 mylist = [
   quite_lengthy_list_item_number_one,
   quite_lengthy_list_item_number_two,
   quite_lengthy_list_item_number_three]

primarily because horizontal real estate is generally cheaper than
vertical real estate.

Nested lists look like this:

 mylist = [[
   item_1_1,
   item_1_2], [
   item_2_1,
   item_2_2]]

Another alternative:

 mylist = 
   [ quite_lengthy_list_item_number_one
   , quite_lengthy_list_item_number_two
   , quite_lengthy_list_item_number_three
   ]

which looks very weird but makes sense, in a twisted sort of way.

Steve Schafer
Fenestra Technologies Corp.
http://www.fenestra.com/


More information about the Haskell-Cafe mailing list