summaryrefslogtreecommitdiff
path: root/src/pandoc.hs
diff options
context:
space:
mode:
authorJohn MacFarlane <fiddlosopher@gmail.com>2012-07-24 19:28:51 -0700
committerJohn MacFarlane <fiddlosopher@gmail.com>2012-07-24 19:38:16 -0700
commit308436996e7311caa257000f4c010686c08a58e7 (patch)
tree10c2d8a88be4dd739fda8975ac79967daba1878c /src/pandoc.hs
parente6c76525b23856fd9f3e17220eba671fc9fc7d74 (diff)
Use catch from Control.Exception to avoid warnings.
Diffstat (limited to 'src/pandoc.hs')
-rw-r--r--src/pandoc.hs19
1 files changed, 12 insertions, 7 deletions
diff --git a/src/pandoc.hs b/src/pandoc.hs
index e6e9c710c..0fd9f37a4 100644
--- a/src/pandoc.hs
+++ b/src/pandoc.hs
@@ -48,6 +48,7 @@ import Data.List ( intercalate, isSuffixOf, isPrefixOf )
import System.Directory ( getAppUserDataDirectory, doesFileExist, findExecutable )
import System.IO ( stdout )
import System.IO.Error ( isDoesNotExistError )
+import qualified Control.Exception as E
import Control.Exception.Extensible ( throwIO )
import qualified Text.Pandoc.UTF8 as UTF8
import qualified Text.CSL as CSL
@@ -840,9 +841,10 @@ main = do
let sources = if ignoreArgs then [] else args
datadir <- case mbDataDir of
- Nothing -> catch
+ Nothing -> E.catch
(liftM Just $ getAppUserDataDirectory "pandoc")
- (const $ return Nothing)
+ (\e -> let _ = (e :: E.SomeException)
+ in return Nothing)
Just _ -> return mbDataDir
-- assign reader and writer based on options and filenames
@@ -893,12 +895,13 @@ main = do
let tp' = case takeExtension tp of
"" -> tp <.> format
_ -> tp
- catch (UTF8.readFile tp')
+ E.catch (UTF8.readFile tp')
(\e -> if isDoesNotExistError e
- then catch
+ then E.catch
(readDataFile datadir $
"templates" </> tp')
- (\_ -> throwIO e)
+ (\e' -> let _ = (e' :: E.SomeException)
+ in throwIO e')
else throwIO e)
variables' <- case mathMethod of
@@ -922,8 +925,10 @@ main = do
-- that we can do lookups with regular string equality
let unescapeRefId ref = ref{ refId = fromEntities (refId ref) }
- refs <- mapM (\f -> catch (CSL.readBiblioFile f) $ \e ->
- err 23 $ "Error reading bibliography `" ++ f ++ "'" ++ "\n" ++ show e)
+ refs <- mapM (\f -> E.catch (CSL.readBiblioFile f)
+ (\e -> let _ = (e :: E.SomeException)
+ in err 23 $ "Error reading bibliography `" ++ f ++
+ "'" ++ "\n" ++ show e))
reffiles >>=
return . map unescapeRefId . concat