[Haskell-cafe] Non-recursive let [Was: GHC bug? Let with guardsloops]

Donn Cave donn at avvanta.com
Wed Jul 10 18:00:42 CEST 2013


quoth Alberto G. Corona,

> Let is "recursive" because, unlike in the case of other
> languages, variables are not locations for storing values, but the
> expressions on the right side of the equality themselves. And obviously it
> is not possible for a variable-expression to be two expressions at the same
> time. The recursiveness is buildt-in. It comes from its pure nature.

I'm surprised that it would come down to purity.  It looks to me like
simply a question of scope.  I had to write an example program to see
what actually happens, because with me it isn't "intuitive" at all that
the name bound to an expression would be "visible" from within the
expression itself.  I suppose this is considered by some to be a feature,
obviously to others it's a bug.

I've gone to some trouble to dig up an nhc98 install (but can't seem to
find one among my computers and GHC 7 won't build the source thanks to
library re-orgs etc.)  Because, I vaguely recall that nhc98's rules
were different here?  Anyone in a position to prove me wrong?

thanks,
	Donn



More information about the Haskell-Cafe mailing list