Tab "\t" character behaviour in (Win)hugs/ghc

Lennart Augustsson lennart@augustsson.net
Wed, 19 Sep 2001 00:25:12 +0200


Brian Boutel wrote:

> Sigbjorn Finne wrote:
> > >
> > > What does the language definition say about this?
> >
> > Nothing at all, I believe, but the convention is for tab characters
> > to be interpreted by an output device as moving the cursor to
> > the next tab stop/alignment column. In the absence of any custom
> > set of tab stops, the convention is to space them evenly every
> > 8 characters.
> >
>
> Actually, Appendix B3 of the Haskell 98 Report says
>
> The "indentation" of a lexeme is the column number indicating the start
> 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 this tab convention: tab stops are 8 characters
> apart, and a tab character causes
> the insertion of enough spaces to align the current position with the
> next tab stop. For the purposes of
> the layout rule, Unicode characters in a source program are considered
> to be of the same, fixed,
> width as an ASCII character. The first column is designated column 1,
> not 0.

Yes, tabs are defined for Haskell source, but not for output of a
Haskell program.

    -- Lennart