From bd433b57386645b6074947c74176d342cc532a6b Mon Sep 17 00:00:00 2001 From: fiddlosopher Date: Thu, 18 Mar 2010 21:35:41 +0000 Subject: Templates: Conditionally import Control.Exception.Extensible if base < 4. git-svn-id: https://pandoc.googlecode.com/svn/trunk@1910 788f1e2b-df1e-0410-8736-df70ead52e1b --- src/Text/Pandoc/Templates.hs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'src') 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 -- cgit v1.2.3