rjmh wrote:
>
> This is in response to your message about removing the overloading of list
> operations in ``Questions on the Table''---actually it more in response to
>the
> message about removing monad comprehension. I'm pretty new to Haskell (and
> functional programming in general), but my understanding is that the existing
> system is precisely the structure required to make comprehension notation
> work, so why would the notation be weakened to just Lists?
>
> This was actually one of the examples raised at the Haskell workshop, that motivated
>the
> decision to design Standard Haskell.
>
> The problem is that if list operations, and especially list comprehensions, are
>overloaded,
> then in some programs the overloading will be ambiguous. In those cases the compiler
> rejects the program, with an error message along the lines of
>
> `ambiguous type variable in class Monad'
>
Hi,
I'd agree that monad comprehensions can result in some fairly confusing
results, when dealing with lists. However, what about thinking about
comprehensions over other bulk types, such as Sets. Simon Peyton Jones's
paper "Bulk types with Class" appears to argue that restricting
programming with bulk types to just lists is a bad idea. It results in a
lack of efficiency and expressiveness. I'm not quite sure what should be
done about this, but I do think that being able to express
comprehensions over more than just lists is a good idea.
Cheers
Meurig
PS I'm glad the suggestion to remove the do syntax, suggested in one of
the Standard Haskell web page mails, appears to be losing. Recently I've
been showing Haskell programs to a fair number of people who have
little, to no, previous experience of functional programming. Its been
VERY useful having the do syntax, as it has made the sequential part of
the functional programs easy to explain.
--
Meurig Sage
Dept of Computing Science
University of Glasgow
http://www.dcs.gla.ac.uk/~meurig
mailto:[EMAIL PROTECTED]