[Haskell] Strange "let"
Ben.Lippmeier at anu.edu.au
Wed Jul 21 01:40:31 EDT 2004
What you've done is redefine the (+) function.. try 10 + 30 and see what
Your local definition shadows the "real" (+) function defined in the
let a + b = 3
is equivalent to
let (+) a b = 3
Jinwoo Lee wrote:
>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
><interactive>:1: Variable not in scope: `a'
><interactive>:1: Variable not in scope: `b'
>What does "let a + b = 3" mean in this case?
>I also tries with GHC compiler using the code below, but it generates no
>main :: IO ()
> do let a + b = 3
> putStrLn "Hello"
>Could somebody answer this?
>Haskell mailing list
>Haskell at haskell.org
More information about the Haskell