git.iko.soy/typeable/pandoc
on master help sign in
Templates: Conditionally import Control.Exception.Extensible if base < 4.

git-svn-id: https://pandoc.googlecode.com/svn/trunk@1910 788f1e2b-df1e-0410-8736-df70ead52e1b

commitbd433b57386645b6074947c74176d342cc532a6b authorfiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b> dateThu 18 Mar 2010, 21:35 (17 years ago) parent56217f1
1 file changed+7−3
src/Text/Pandoc/Templates.hs+7−3
src/Text/Pandoc/Templates.hs+7−3
@@ -70,15 +70,19 @@ module Text.Pandoc.Templates ( renderTemplate
7070
7171import Text.ParserCombinators.Parsec
7272import Control.Monad (liftM, when, forM)
73−import qualified Control.Exception as E (try, IOException)
7473import System.FilePath
7574import Data.List (intercalate, intersperse)
7675import Text.PrettyPrint (text, Doc)
7776import Text.XHtml (primHtml, Html)
7877import Data.ByteString.Lazy.UTF8 (ByteString, fromString)
7978import Text.Pandoc.Shared (readDataFile)
80−-- Note: ghc >= 6.12 (base >=4.2) supports unicode through iconv
81−-- So we use System.IO.UTF8 only if we have an earlier version
79+-- Note: it would be simpler just to use Control.Exception.Extensible
80+-- for all versions of base, but extensible-exceptions is not in debian.
81+#if MIN_VERSION_base(4,0,0)
82+import qualified Control.Exception as E (try, IOException)
83+#else
84+import qualified Control.Exception.Extensible as E (try, IOException)
85+#endif
8286
8387-- | Get default template for the specified writer.
8488getDefaultTemplate :: (Maybe FilePath) -- ^ User data directory to search first