Re: [Haskell-cafe] Coding conventions for Haskell?

On 29/09/2010 02:18 PM, Henning Thielemann wrote:
Andrew Coppin wrote:
Tastes do indeed vary. To me, both of these are incorrect, and the correct way is
data Foo a b = Foo a | Bar b | Foobar a b deriving (Eq, Ord)
The truth is: Given the separator style of constructor definition, there is no correct way to format those declarations. :-) The correct way would be to allow terminator style.
Well, yes, there is that. (And this isn't the only place in the syntax where it applies either. Tried editing export lists lately? Or Cabal module lists?)

Andrew Coppin schrieb:
On 29/09/2010 02:18 PM, Henning Thielemann wrote:
The truth is: Given the separator style of constructor definition, there is no correct way to format those declarations. :-) The correct way would be to allow terminator style.
Well, yes, there is that. (And this isn't the only place in the syntax where it applies either. Tried editing export lists lately? Or Cabal module lists?)
In export and import lists you can use commas as terminators, however in constructor lists you cannot. module A (a, b, c, T(A,B,C), ) where import X (x, Y(M,N,O), z, ) In Cabal you can write one module per line and need no separator or terminator at all.

On 30/09/2010 02:56 PM, Henning Thielemann wrote:
Andrew Coppin schrieb:
On 29/09/2010 02:18 PM, Henning Thielemann wrote:
The truth is: Given the separator style of constructor definition, there is no correct way to format those declarations. :-) The correct way would be to allow terminator style. Well, yes, there is that. (And this isn't the only place in the syntax where it applies either. Tried editing export lists lately? Or Cabal module lists?) In export and import lists you can use commas as terminators, however in constructor lists you cannot.
I accidentally discovered that it works in export lists a few weeks ago. I assumed it was a bug.
In Cabal you can write one module per line and need no separator or terminator at all.
Really? As far as I can tell, that doesn't work at all...

Andrew Coppin schrieb:
On 30/09/2010 02:56 PM, Henning Thielemann wrote:
In Cabal you can write one module per line and need no separator or terminator at all.
Really? As far as I can tell, that doesn't work at all...
See e.g. http://hackage.haskell.org/packages/archive/utility-ht/0.0.5.1/utility-ht.ca...
participants (2)
-
Andrew Coppin
-
Henning Thielemann