[erlang-questions] [Off-topic] Haskell type constructor syntax

ok <>
Wed Sep 12 01:13:03 CEST 2007

On 11 Sep 2007, at 6:59 am, David Hopwood wrote:

> ok wrote:
>> On 8 Sep 2007, at 2:12 am, Tony Finch wrote:
>>> I'd suggest using initial caps for type names, and omit the ()  
>>> except
>>> when the type parameter is non-trivial. (That is somewhat like the
>>> Haskell type syntax.)
>> It would be more accurate to describe it as "as unlike the Haskell
>> syntax as possible".  Haskell uses the same conventions for type
>> (constructors/variables) as for data (constructors/variables), so to
>> be close to Haskell syntax, you have to use the same spelling for
>> type constructors as you do for constants, namely, LOWER case.
> You're mistaken about Haskell syntax -- it does use initial
> uppercase for type constructors.

How can I be mistaken about that when THAT'S WHAT I SAID?

Haskell uses the same convention for type variables as for
data variables:  initial lower case.  To follow Haskell
*principles*, Erlang type variables (should it have any)
would use the same convention as Erlang data variables,
namely initial capital letters.

Haskell uses the same convention for type constructors as for
data constructors.  It uses initial capitals for both.
To follow the Haskell *principles* then, one would have to use
the same convention for Erlang type constructors as for Erlang
data constructors (= atoms), which is initial lower case.

More information about the erlang-questions mailing list