[Haskell-cafe] let vs do?

Thomas Schilling nominolo at googlemail.com
Thu Jun 28 16:34:28 EDT 2007


On 28 jun 2007, at 22.02, Greg Meredith wrote:

> Thomas,
>
> Thanks for the reply. My thinking was that once you have a  
> polymorphic form, why single out any other? Less moving parts makes  
> for less maintenance, etc.
>

Ok, sorry if my reply seemed harsh.  You are of course right, that  
having few primitives is better.  In Haskell you have two primives:   
function binding and let-binding.  Let bindings are always recursive,  
thus

   let x = e in body   =/=   (\x -> body) e

because x also is bound to itself in "e".

Since, do-binding is defined in terms of normal lambda-binding, there  
are no more primitives.

/ Thomas


PS: "let" is treated specially by the type-checker too.  The  
technical term is "let-polymorphism", but I couldn't find any good  
results, using a quick google search.  Hopefully, others will chime in.


More information about the Haskell-Cafe mailing list