Error in documentation for Control.Exception (base-4.*)
Ivan Lazar Miljenovic
ivan.miljenovic at gmail.com
Wed Jun 29 07:37:15 CEST 2011
This was caught by mbuf on #haskell: the example for the Exception
class in Control.Exception as of base-4 needs some extra escaping for
Haddock markup. It currently has:
@
*Main> throw ThisException `catch` \e -> putStrLn (\"Caught \" ++ show
(e :: MyException))
Caught ThisException
@
It should be (untested; I'm not sure of the backticks but I think it'll work):
@
*Main> throw ThisException \`catch\` \\e -> putStrLn (\"Caught \" ++
show (e :: MyException))
Caught ThisException
@
It may even be better to use the new support for examples in Haddock
(section 3.8.5 of http://www.haskell.org/haddock/doc/html/ch03s08.html
):
@
>>> throw ThisException \`catch\` \\e -> putStrLn (\"Caught \" ++ show (e :: MyException))
Caught ThisException
@
--
Ivan Lazar Miljenovic
Ivan.Miljenovic at gmail.com
IvanMiljenovic.wordpress.com
More information about the Libraries
mailing list