John Launchbury and Levent Erkok wrote:
| We are trying to determine how important it is to have
| polymorphic let-bindings in the do-expression.
You cannot ask a question like this without explaining why
you are interested in this subject! :-) Just out of
curiosity... (I think that it is has to do with a recursive
do-translation, am I right? I don't think it is very nice to
make such a rather arbitrary (because that is how it will
seem to the programmer) restriction...)
I think one should expect the same answers to this question
as answers to the question: "How important is it to have
polymorphism in local let-bindings?" The answer to that is:
"Not that often, but sometimes there is this really neat
solution which requires a locally polymorphic let-binding."
I have just gone through a lot of code, and my answer is: I
do not use it often, but sometimes. Typically, when having a
(polymorphic) binding on top-level:
fun x = .. x ..
which you want to depend on a few state variables or
something, then I do the following:
funWrapper y = runST computation
where
computation =
do var <- newSTRef []
let fun x = .. var .. x ..
fun y
Marcin 'Qrczak' Kowalczyk notes:
| I've just checked that I probably. never used that.
| And if someone would, it could be easily rewritten.
I don't buy the argument of "it could be easily rewritten".
This is true for most of Haskell's syntatic sugar (one
doesn't even need the whole do-notation).
Regards,
Koen.
--
Koen Claessen http://www.cs.chalmers.se/~koen
phone:+46-31-772 5424 mailto:[EMAIL PROTECTED]
-----------------------------------------------------
Chalmers University of Technology, Gothenburg, Sweden