Levent Erkok wrote:

 | In particular, the person who indicated that he has
 | "sometimes used" polymorphic let-generators stated
 | that he can always rewrite the code without using
 | them.

That same person also said that this is the case for many
other Haskell features, such as list comprehensions, do-
notation, nested pattern matching, named fields in data
constructors, etc.

But these features are there because people like to use
them, and it makes programming and reading code easier.

Now, obviously there are not that many people who use
polymorphic let-bindings in do, but I don't think that is a
reason to introduce this restriction.

One of the things that makes (polymorphic) functional
programming so great, is that you can "do the same with
things that look the same".

If a language has the property that in one place, one can
use a "let" block to define polymorphic bindings, and in
another place one can only use it for monomorphic bindings,
then I think that is bad language design.

(But Haskell already has a comparable property with the
monomorphism restriction.)

On the other hand, recursive do-notation is obviously is a
great feature that many (at least I) have been wanting for
some time now. If that feature implies monomorphic let
bindings in do-notation, then there is clearly a trade-off
to make. But don't use the argument "nobody is using this
feature" to make the language design less consistent.

Now, send us all a pointer to your work! :-) (I want to read
about it!!),
Koen.

(ceterum censeo restrictionem monomorfismi esse delendam)

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


Reply via email to