[Haskell-cafe] A small error

Andrew Coppin andrewcoppin at btinternet.com
Sat May 19 10:43:57 EDT 2007


Um... why doesn't this work?

my_fn x = do
  if x < 0
    then do
      let y = 5
      return ()
    else do
      let y = 8
      return ()

  print y

(Error: "y" is not in scope.)



More information about the Haskell-Cafe mailing list