aboutsummaryrefslogtreecommitdiff
path: root/src/Text
diff options
context:
space:
mode:
authorJesse Rosenthal <jrosenthal@jhu.edu>2016-08-31 17:44:07 -0400
committerJesse Rosenthal <jrosenthal@jhu.edu>2016-09-02 09:18:09 -0400
commit7f676b534aa82ae44c62d854c5d29d46c3d2c30a (patch)
tree4ad98f768046b36dbfa95681b7ce97e4951b3e8f /src/Text
parent26c3705da4207af2af4dfc35737d44a18ee400e5 (diff)
downloadpandoc-7f676b534aa82ae44c62d854c5d29d46c3d2c30a.tar.gz
Remove Text.Pandoc.Compat.Except
Diffstat (limited to 'src/Text')
-rw-r--r--src/Text/Pandoc/Error.hs5
-rw-r--r--src/Text/Pandoc/ImageSize.hs3
-rw-r--r--src/Text/Pandoc/Readers/DocBook.hs2
-rw-r--r--src/Text/Pandoc/Readers/Docx.hs2
-rw-r--r--src/Text/Pandoc/Readers/Docx/Parse.hs5
-rw-r--r--src/Text/Pandoc/Readers/EPUB.hs2
-rw-r--r--src/Text/Pandoc/Readers/OPML.hs2
7 files changed, 6 insertions, 15 deletions
diff --git a/src/Text/Pandoc/Error.hs b/src/Text/Pandoc/Error.hs
index 292396aee..5e26771fe 100644
--- a/src/Text/Pandoc/Error.hs
+++ b/src/Text/Pandoc/Error.hs
@@ -33,7 +33,6 @@ module Text.Pandoc.Error (PandocError(..), handleError) where
import Text.Parsec.Error
import Text.Parsec.Pos hiding (Line)
-import Text.Pandoc.Compat.Except
import GHC.Generics (Generic)
import Data.Generics (Typeable)
import Control.Exception (Exception)
@@ -48,10 +47,6 @@ data PandocError = -- | Generic parse failure
instance Exception PandocError
-instance Error PandocError where
- strMsg = ParseFailure
-
-
-- | An unsafe method to handle `PandocError`s.
handleError :: Either PandocError a -> a
handleError (Right r) = r
diff --git a/src/Text/Pandoc/ImageSize.hs b/src/Text/Pandoc/ImageSize.hs
index 90dfbb5fb..e46c91eda 100644
--- a/src/Text/Pandoc/ImageSize.hs
+++ b/src/Text/Pandoc/ImageSize.hs
@@ -59,8 +59,7 @@ import Numeric (showFFloat)
import Text.Pandoc.Definition
import Text.Pandoc.Options
import qualified Data.Map as M
-import Text.Pandoc.Compat.Except
-import Control.Monad.Trans
+import Control.Monad.Except
import Data.Maybe (fromMaybe)
-- quick and dirty functions to get image sizes
diff --git a/src/Text/Pandoc/Readers/DocBook.hs b/src/Text/Pandoc/Readers/DocBook.hs
index e8fe92e27..9bd51f5a8 100644
--- a/src/Text/Pandoc/Readers/DocBook.hs
+++ b/src/Text/Pandoc/Readers/DocBook.hs
@@ -14,7 +14,7 @@ import Data.List (intersperse)
import Data.Maybe (fromMaybe)
import Text.TeXMath (readMathML, writeTeX)
import Text.Pandoc.Error (PandocError)
-import Text.Pandoc.Compat.Except
+import Control.Monad.Except
import Data.Default
import Data.Foldable (asum)
diff --git a/src/Text/Pandoc/Readers/Docx.hs b/src/Text/Pandoc/Readers/Docx.hs
index b51572783..fa534f801 100644
--- a/src/Text/Pandoc/Readers/Docx.hs
+++ b/src/Text/Pandoc/Readers/Docx.hs
@@ -98,7 +98,7 @@ import Data.Traversable (traverse)
#endif
import Text.Pandoc.Error
-import Text.Pandoc.Compat.Except
+import Control.Monad.Except
readDocxWithWarnings :: ReaderOptions
-> B.ByteString
diff --git a/src/Text/Pandoc/Readers/Docx/Parse.hs b/src/Text/Pandoc/Readers/Docx/Parse.hs
index 3efdb70a8..b9021ec08 100644
--- a/src/Text/Pandoc/Readers/Docx/Parse.hs
+++ b/src/Text/Pandoc/Readers/Docx/Parse.hs
@@ -64,7 +64,7 @@ import Control.Monad.Reader
import Control.Monad.State
import Control.Applicative ((<|>))
import qualified Data.Map as M
-import Text.Pandoc.Compat.Except
+import Control.Monad.Except
import Text.Pandoc.Shared (safeRead)
import Text.TeXMath.Readers.OMML (readOMML)
import Text.Pandoc.Readers.Docx.Fonts (getUnicode, Font(..))
@@ -91,9 +91,6 @@ data ReaderState = ReaderState { stateWarnings :: [String] }
data DocxError = DocxError | WrongElem
deriving Show
-instance Error DocxError where
- noMsg = WrongElem
-
type D = ExceptT DocxError (ReaderT ReaderEnv (State ReaderState))
runD :: D a -> ReaderEnv -> ReaderState -> (Either DocxError a, ReaderState)
diff --git a/src/Text/Pandoc/Readers/EPUB.hs b/src/Text/Pandoc/Readers/EPUB.hs
index 36c52aecb..e547b84cd 100644
--- a/src/Text/Pandoc/Readers/EPUB.hs
+++ b/src/Text/Pandoc/Readers/EPUB.hs
@@ -16,7 +16,7 @@ import Text.Pandoc.Options ( ReaderOptions(..), readerTrace)
import Text.Pandoc.Shared (escapeURI, collapseFilePath, addMetaField)
import Network.URI (unEscapeString)
import Text.Pandoc.MediaBag (MediaBag, insertMedia)
-import Text.Pandoc.Compat.Except (MonadError, throwError, runExcept, Except)
+import Control.Monad.Except (MonadError, throwError, runExcept, Except)
import Text.Pandoc.MIME (MimeType)
import qualified Text.Pandoc.Builder as B
import Codec.Archive.Zip ( Archive (..), toArchiveOrFail, fromEntry
diff --git a/src/Text/Pandoc/Readers/OPML.hs b/src/Text/Pandoc/Readers/OPML.hs
index b2e5f2e67..7ee9ef398 100644
--- a/src/Text/Pandoc/Readers/OPML.hs
+++ b/src/Text/Pandoc/Readers/OPML.hs
@@ -11,7 +11,7 @@ import Text.Pandoc.Compat.TagSoupEntity (lookupEntity)
import Data.Generics
import Control.Monad.State
import Data.Default
-import Text.Pandoc.Compat.Except
+import Control.Monad.Except
import Text.Pandoc.Error
type OPML = ExceptT PandocError (State OPMLState)