He Prad,
do line <- getLine
putStr "You entered: "
putStrLn line
The example of Ertugrul is desugared to the following:
getLine >>= \x -> putStr "You entered: " >> putStrLn x
or even:
getLine >>= \x -> putStr "You entered: " >>= (\_ -> putStrLn x)
It helps a lot to not use the sugared syntax, until you know how to write them without the sugar. That way you will grasp the concept of monads much faster.
it is also a matter of taste, for small monadic functions I prefer the desugared style. For longer it becomes a bit unwieldy.
Greetings,
Edgar