[Haskell] Re: Use of tab characters in indentation-sensitive code

George Russell ger at informatik.uni-bremen.de
Mon Jan 26 10:44:19 EST 2004


Graham Klyne wrote (according to Wolfgang Thaller, snipped):
 > I think that compilers should issue a warning when indentation that
 > determines the scope of a construct is found to contain tab characters.

In an ideal world, TAB characters would never have been put into ASCII, and
this would be my preferred solution.  However, since there would be some people
who would object to such purity, a better alternative might be
(a) to allow
m TABs followed by n spaces
at the start of lines.
(b) to denote the indention of the line by the two numbers (m,n).
(c) to give an error message when comparing two indentions (m1,n1),(m2,n2) where
neither m1<=m2,n1<=n2, nor m1>=m2,n1>=n2.

Incidentally Unicode allows far more possibilities for fun with indentation (for example
half-spaces, IIRC).




More information about the Haskell mailing list