aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorfiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b>2010-03-18 21:35:41 +0000
committerfiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b>2010-03-18 21:35:41 +0000
commitbd433b57386645b6074947c74176d342cc532a6b (patch)
treefd6d9d37502691ef4552b0111ae7ea2def88d10d /src
parent56217f100404bc277c53518436ea93973c7705ac (diff)
downloadpandoc-bd433b57386645b6074947c74176d342cc532a6b.tar.gz
Templates: Conditionally import Control.Exception.Extensible if base < 4.
git-svn-id: https://pandoc.googlecode.com/svn/trunk@1910 788f1e2b-df1e-0410-8736-df70ead52e1b
Diffstat (limited to 'src')
-rw-r--r--src/Text/Pandoc/Templates.hs10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/Text/Pandoc/Templates.hs b/src/Text/Pandoc/Templates.hs
index 3771e1fd2..b8d186759 100644
--- a/src/Text/Pandoc/Templates.hs
+++ b/src/Text/Pandoc/Templates.hs
@@ -70,15 +70,19 @@ module Text.Pandoc.Templates ( renderTemplate
import Text.ParserCombinators.Parsec
import Control.Monad (liftM, when, forM)
-import qualified Control.Exception as E (try, IOException)
import System.FilePath
import Data.List (intercalate, intersperse)
import Text.PrettyPrint (text, Doc)
import Text.XHtml (primHtml, Html)
import Data.ByteString.Lazy.UTF8 (ByteString, fromString)
import Text.Pandoc.Shared (readDataFile)
--- Note: ghc >= 6.12 (base >=4.2) supports unicode through iconv
--- So we use System.IO.UTF8 only if we have an earlier version
+-- Note: it would be simpler just to use Control.Exception.Extensible
+-- for all versions of base, but extensible-exceptions is not in debian.
+#if MIN_VERSION_base(4,0,0)
+import qualified Control.Exception as E (try, IOException)
+#else
+import qualified Control.Exception.Extensible as E (try, IOException)
+#endif
-- | Get default template for the specified writer.
getDefaultTemplate :: (Maybe FilePath) -- ^ User data directory to search first