Talk:Write Yourself a Scheme in 48 Hours/Error Checking and Exceptions

Either is not a monad, see for example the following Hugs session:

The bind operator does not have a higher precedence than function application (no operator has); this can be demonstrated with Hugs as follows:

Control.Monad> show (Just 0) >>= return. sin ERROR - Cannot infer instance *** Instance  : Floating Char *** Expression : show (Just 0) >>= return. sin Control.Monad> show $ (Just 0) >>= return. sin "Just 0.0"

"As a result, we go back to do-notation, because it's nearly impossible to use point-free style when the result of one monad is nested inside another." This makes it sound to appear more difficult than it is. While it's not point free style (I'm sure it can be), it comes close:

main = liftM head getArgs >>= \arg -> putStrLn. fromRight. trapError. liftM show $ readExpr arg >>= eval --sebnow 13:19, 2 Dev 2010 (UTC)

Control.Monad.Error is deprecated
Not sure in what version this was deprecated, but with version 8.0.1 of GHC, I get

parser.hs:6:1: warning: [-Wdeprecations] Module ‘Control.Monad.Error’ is deprecated: Use Control.Monad.Except instead