Which tab width do you prefer for Haskell code?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Which tab width do you prefer for Haskell code?

Christopher Done-2
Hi everyone,

I'm trying to get a feel for the modern Haskell community's opinion on
default tab-width for HIndent. Here is a link to the online poll:

http://doodle.com/poll/82xf854t9mmuv22h#table

Quote:

> For the HIndent tool we'd like to choose the standard tab width.
> For now, it is 4, the width set by the Johan Tibell style guide.
> A survey of 1000 top-downloaded packages on Hackage reveals about 50-50 either way:https://gist.github.com/chrisdone/e3d1796d8f5df717b91db54aae36c440
> HIndent is meant as a "community standard" tool; it should reflect the community's actual practice. If there's a clear preference for 2, we'll switch to that. Otherwise, we remain with 4.

Cheers!
_______________________________________________
Haskell-Cafe mailing list
To (un)subscribe, modify options or view archives go to:
http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
Only members subscribed via the mailman list are allowed to post.
Reply | Threaded
Open this post in threaded view
|

Re: Which tab width do you prefer for Haskell code?

Richard A. O'Keefe


On 30/08/16 6:09 AM, Christopher Done wrote:

> Hi everyone,
>
> I'm trying to get a feel for the modern Haskell community's opinion on
> default tab-width for HIndent. Here is a link to the online poll:
>
> http://doodle.com/poll/82xf854t9mmuv22h#table
>
> Quote:
>
>> For the HIndent tool we'd like to choose the standard tab width.
>> For now, it is 4, the width set by the Johan Tibell style guide.
>> A survey of 1000 top-downloaded packages on Hackage reveals about 50-50 either way:https://gist.github.com/chrisdone/e3d1796d8f5df717b91db54aae36c440
>> HIndent is meant as a "community standard" tool; it should reflect the community's actual practice. If there's a clear preference for 2, we'll switch to that. Otherwise, we remain with 4.

There seems to be some confusion here.
The Johan Tibell style guide does NOT "set"
"the standard tab width" to 4.  Far from it!
The guide says plainly "TABS ARE ILLEGAL".

What the style guide talks about is INDENTATION steps.
Not tab width!

When it comes to TAB width, the Haskell 2010 report
is explicit and unambiguous, leaving no room for
anyone's preferences.  Chapter 10 says

        The "indentation" of a lexeme is the column number
        of the first character of that lexeme;
        the indentation of a line is the indentation of
        its leftmost lexeme.
        To determine the column number, assume a fixed-
        width font with the following conventions:
        * The characters newline, return, linefeed,
          and formfeed, all start a new line.
        * The first column is designated column 1, not 0.
        * TAB STOPS ARE 8 CHARACTERS APART.
        * A tab character causes the insertion of enough
          spaces to align the current position with the
          next tab stop.
_______________________________________________
Haskell-Cafe mailing list
To (un)subscribe, modify options or view archives go to:
http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
Only members subscribed via the mailman list are allowed to post.
Reply | Threaded
Open this post in threaded view
|

Re: Which tab width do you prefer for Haskell code?

Christopher Allen
When most Haskellers say tab width, they're colloquially referring to
how many literal spaces each "indent" action should be.

That is the case here as well. Most Haskellers I know do not use tabs
at all to avoid indent issues, unlike Golang which is exclusively
tabs.

On Mon, Aug 29, 2016 at 10:56 PM, Richard A. O'Keefe <[hidden email]> wrote:

>
>
> On 30/08/16 6:09 AM, Christopher Done wrote:
>>
>> Hi everyone,
>>
>> I'm trying to get a feel for the modern Haskell community's opinion on
>> default tab-width for HIndent. Here is a link to the online poll:
>>
>> http://doodle.com/poll/82xf854t9mmuv22h#table
>>
>> Quote:
>>
>>> For the HIndent tool we'd like to choose the standard tab width.
>>> For now, it is 4, the width set by the Johan Tibell style guide.
>>> A survey of 1000 top-downloaded packages on Hackage reveals about 50-50
>>> either
>>> way:https://gist.github.com/chrisdone/e3d1796d8f5df717b91db54aae36c440
>>> HIndent is meant as a "community standard" tool; it should reflect the
>>> community's actual practice. If there's a clear preference for 2, we'll
>>> switch to that. Otherwise, we remain with 4.
>
>
> There seems to be some confusion here.
> The Johan Tibell style guide does NOT "set"
> "the standard tab width" to 4.  Far from it!
> The guide says plainly "TABS ARE ILLEGAL".
>
> What the style guide talks about is INDENTATION steps.
> Not tab width!
>
> When it comes to TAB width, the Haskell 2010 report
> is explicit and unambiguous, leaving no room for
> anyone's preferences.  Chapter 10 says
>
>         The "indentation" of a lexeme is the column number
>         of the first character of that lexeme;
>         the indentation of a line is the indentation of
>         its leftmost lexeme.
>         To determine the column number, assume a fixed-
>         width font with the following conventions:
>         * The characters newline, return, linefeed,
>           and formfeed, all start a new line.
>         * The first column is designated column 1, not 0.
>         * TAB STOPS ARE 8 CHARACTERS APART.
>         * A tab character causes the insertion of enough
>           spaces to align the current position with the
>           next tab stop.
>
> _______________________________________________
> Haskell-Cafe mailing list
> To (un)subscribe, modify options or view archives go to:
> http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
> Only members subscribed via the mailman list are allowed to post.



--
Chris Allen
Currently working on http://haskellbook.com
_______________________________________________
Haskell-Cafe mailing list
To (un)subscribe, modify options or view archives go to:
http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
Only members subscribed via the mailman list are allowed to post.
Reply | Threaded
Open this post in threaded view
|

Re: Which tab width do you prefer for Haskell code?

Roel van Dijk-3
In reply to this post by Christopher Done-2
Please note that, apparently, anonymous users can delete comments and edit and delete existing entries. I can change my own entry that I created yesterday on a separate system.

2016-08-29 20:09 GMT+02:00 Christopher Done <[hidden email]>:
Hi everyone,

I'm trying to get a feel for the modern Haskell community's opinion on
default tab-width for HIndent. Here is a link to the online poll:

http://doodle.com/poll/82xf854t9mmuv22h#table

Quote:

> For the HIndent tool we'd like to choose the standard tab width.
> For now, it is 4, the width set by the Johan Tibell style guide.
> A survey of 1000 top-downloaded packages on Hackage reveals about 50-50 either way:https://gist.github.com/chrisdone/e3d1796d8f5df717b91db54aae36c440
> HIndent is meant as a "community standard" tool; it should reflect the community's actual practice. If there's a clear preference for 2, we'll switch to that. Otherwise, we remain with 4.

Cheers!
_______________________________________________
Haskell-Cafe mailing list
To (un)subscribe, modify options or view archives go to:
http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
Only members subscribed via the mailman list are allowed to post.


_______________________________________________
Haskell-Cafe mailing list
To (un)subscribe, modify options or view archives go to:
http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
Only members subscribed via the mailman list are allowed to post.
Reply | Threaded
Open this post in threaded view
|

Re: Which tab width do you prefer for Haskell code?

Paolo Giarrusso
On Tuesday, August 30, 2016 at 9:35:42 AM UTC+2, Roel van Dijk wrote:
Please note that, apparently, anonymous users can delete comments and edit and delete existing entries. I can change my own entry that I created yesterday on a separate system.

FWIW Anonymous users can delete anonymous entries on Doodle—if you vote after logging in, your vote and comments are locked in.


2016-08-29 20:09 GMT+02:00 Christopher Done <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="wiJz0wwzBQAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">chri...@...>:
Hi everyone,

I'm trying to get a feel for the modern Haskell community's opinion on
default tab-width for HIndent. Here is a link to the online poll:

<a href="http://doodle.com/poll/82xf854t9mmuv22h#table" rel="nofollow" target="_blank" onmousedown="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fdoodle.com%2Fpoll%2F82xf854t9mmuv22h%23table\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHWrVS8zhYqD3RY2Q74HShfesFLsA&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fdoodle.com%2Fpoll%2F82xf854t9mmuv22h%23table\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHWrVS8zhYqD3RY2Q74HShfesFLsA&#39;;return true;">http://doodle.com/poll/82xf854t9mmuv22h#table

Quote:

> For the HIndent tool we'd like to choose the standard tab width.
> For now, it is 4, the width set by the Johan Tibell style guide.
> A survey of 1000 top-downloaded packages on Hackage reveals about 50-50 either way:<a href="https://gist.github.com/chrisdone/e3d1796d8f5df717b91db54aae36c440" rel="nofollow" target="_blank" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgist.github.com%2Fchrisdone%2Fe3d1796d8f5df717b91db54aae36c440\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHlnRvW7ShfF2EW5QHxtoO0pYZung&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgist.github.com%2Fchrisdone%2Fe3d1796d8f5df717b91db54aae36c440\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHlnRvW7ShfF2EW5QHxtoO0pYZung&#39;;return true;">https://gist.github.com/chrisdone/e3d1796d8f5df717b91db54aae36c440
> HIndent is meant as a "community standard" tool; it should reflect the community's actual practice. If there's a clear preference for 2, we'll switch to that. Otherwise, we remain with 4.

Cheers!
_______________________________________________
Haskell-Cafe mailing list
To (un)subscribe, modify options or view archives go to:
<a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe" rel="nofollow" target="_blank" onmousedown="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fmail.haskell.org%2Fcgi-bin%2Fmailman%2Flistinfo%2Fhaskell-cafe\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNH7sFgl7KfuDcDlaGGG3ip3kRaoIA&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fmail.haskell.org%2Fcgi-bin%2Fmailman%2Flistinfo%2Fhaskell-cafe\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNH7sFgl7KfuDcDlaGGG3ip3kRaoIA&#39;;return true;">http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
Only members subscribed via the mailman list are allowed to post.


_______________________________________________
Haskell-Cafe mailing list
To (un)subscribe, modify options or view archives go to:
http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
Only members subscribed via the mailman list are allowed to post.