Hello all!

There has been a discussion going on about if the list
constructor operators (:, [], and type []) should be dealt
with in the same way as with other function and type names.

I think there are two separate issues here:

  1. Introduction of special syntactic identifiers for:
       
       - the type constructor [], and the applied
         version [a],

       - the empty list constructor [] (and maybe
         also the cons constructor :, but that one
         fits in normal Haskell operator syntax).

  2. Syntactic sugar which is translated away using prelude
     functions. This includes:

       - list notation, [1,2,3,4,5],

       - list comprehensions, [ (x,y) | x <- xs, y <- ys ],

     but also:

       - do-notation,

       - integer constants,

       - (and maybe others).

About issue number 1, I don't think there is any problem in
making [] special syntax for some type constructor, of which
[a] is the applied version. This means [] is just a normal
(type constructor) name which we can import and export.

Issue number 2 is completely different and unrelated. Note
that this also includes normal prelude functions without
special syntax (such as >>=, return, mfail, fromInteger,
etc.). What happens in general when one uses this special
notation in a module which redefines these operators? I
think the easiest thing to do is just to make the
translation *always* refer to their prelude definitions.

Just my 2 �re...

Regards,
Koen.

--
Koen Claessen         http://www.cs.chalmers.se/~koen     
phone:+46-31-772 5424      e-mail:[EMAIL PROTECTED]
-----------------------------------------------------
Chalmers University of Technology, Gothenburg, Sweden


Reply via email to