[Haskell-cafe] let and fixed point operator

Dan Piponi dpiponi at gmail.com
Thu Aug 30 13:41:11 EDT 2007

On 8/30/07, Andrew Coppin <andrewcoppin at btinternet.com> wrote:
> Obviously you might very well have *meant* to write x = f x. But would
> it be possible to add some kind of optional compiler warning to find
> such assignments?

The thing that convinced me to learn Haskell in the first place was
the fact that you could write x = f x. Equations where you refer to
the same variable on the left and right hand sides are the bread of
butter and mathematics, and I was really pleased to find a programming
language that let me do the same. So to me the idea of having a
warning for this is a bit like putting a sign on bottled water saying
"Warning: Contents may be wet". But that's just me. :-)

Still, it might be useful to for the compiler to warn when a newly
introduced name shadows another one.

More information about the Haskell-Cafe mailing list