[Haskell] Strange "let"

Martin Grabmueller magr at cs.tu-berlin.de
Wed Jul 21 04:47:47 EDT 2004


Jinwoo Lee wrote:
> Hi,
>  
> I'm a Haskell newbie.
>  
> I was trying several things with GHCi and found out that the expression "let
> a + b = 3" does not generate any errors.
>  
> Prelude> let a + b = 3

Try this:

Prelude> let a + b = 3
Prelude> 5+11
3

Your `let a+b=3' has redefined `+' to be a function always
evaluating to 3.  `a' and `b' are formal parameters of the
newly defined function.

Martin


More information about the Haskell mailing list