From Learn You a Haskell ("Let it be" section):

   1. cylinder :: (RealFloat a) => a -> a -> a  
   2. cylinder r h =
   3.     let sideArea = 2 * pi * r * h  
   4.         topArea = pi * r ^2  
   5.     in  sideArea + 2 * topArea
===================

What's the proper indentation for LET so these problems (below) don't arise? I thought LET and IN should be aligned in the same column. Also, isn't a LET expression an "expression."

Michael

==============

This works:

import System.Random
main = do
  gen <- getStdGen
  let (randNumber, newGen) = randomR (1,6) gen :: (Int, StdGen)
    in putStrLn $ "Number is " ++ show randNumber

==============

This works:

import System.Random
main = do
  gen <- getStdGen
  let (randNumber, newGen) = randomR (1,6) gen :: (Int, StdGen)
  putStrLn $ "Number is " ++ show randNumber

==============

This doesn't:

import System.Random
main = do
  gen <- getStdGen
  let (randNumber, newGen) = randomR (1,6) gen :: (Int, StdGen)
  in putStrLn $ "Number is " ++ show randNumber

[michael@localhost ~]$ runhaskell zz.hs

zz.hs:4:2:
    The last statement in a 'do' construct must be an expression