git.iko.soy/typeable/pandoc
on master help sign in
Define Typeable and Exception instances for PandocError.

Closes #2386.

commit04307a155407480c2bedd4c6f9c121640ba47b11 authorJohn MacFarlane <jgm@berkeley.edu> dateSun 11 Oct 2015, 15:50 (11 years ago) parent0e78eba
1 file changed+6−1
src/Text/Pandoc/Error.hs+6−1
src/Text/Pandoc/Error.hs+6−1
@@ -1,3 +1,4 @@
1+{-# LANGUAGE DeriveDataTypeable, DeriveGeneric #-}
12{-
23Copyright (C) 2006-2015 John MacFarlane <jgm@berkeley.edu>
34
@@ -33,6 +34,9 @@ module Text.Pandoc.Error (PandocError(..), handleError) where
3334import Text.Parsec.Error
3435import Text.Parsec.Pos hiding (Line)
3536import Text.Pandoc.Compat.Except
37+import GHC.Generics (Generic)
38+import Data.Generics (Data, Typeable)
39+import Control.Exception (Exception)
3640
3741type Input = String
3842
@@ -40,8 +44,9 @@ data PandocError = -- | Generic parse failure
4044 ParseFailure String
4145 -- | Error thrown by a Parsec parser
4246 | ParsecError Input ParseError
43− deriving (Show)
47+ deriving (Show, Typeable, Generic)
4448
49+instance Exception PandocError
4550
4651instance Error PandocError where
4752 strMsg = ParseFailure