aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Readers/Odt/Generic
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2017-06-20 22:43:06 +0200
committerJohn MacFarlane <jgm@berkeley.edu>2017-06-20 22:43:06 +0200
commit21c4281b13bf2d72012139ecc5c16cf7cae21de1 (patch)
tree0218aed6a9da540c38ba4745b82309760183318c /src/Text/Pandoc/Readers/Odt/Generic
parentc0a12860253c2ddf67d6e9bcb0d6b67f4be18c18 (diff)
downloadpandoc-21c4281b13bf2d72012139ecc5c16cf7cae21de1.tar.gz
Odt reader: replaced collectRights with rights from Data.Either.
Diffstat (limited to 'src/Text/Pandoc/Readers/Odt/Generic')
-rw-r--r--src/Text/Pandoc/Readers/Odt/Generic/Fallible.hs5
-rw-r--r--src/Text/Pandoc/Readers/Odt/Generic/XMLConverter.hs3
2 files changed, 2 insertions, 6 deletions
diff --git a/src/Text/Pandoc/Readers/Odt/Generic/Fallible.hs b/src/Text/Pandoc/Readers/Odt/Generic/Fallible.hs
index 4d6a67b8e..8c47cdaf5 100644
--- a/src/Text/Pandoc/Readers/Odt/Generic/Fallible.hs
+++ b/src/Text/Pandoc/Readers/Odt/Generic/Fallible.hs
@@ -124,8 +124,3 @@ instance ChoiceVector SuccessList where
spreadChoice = Right . SuccessList . (foldr unTagRight []) . collectNonFailing
where unTagRight (Right x) = (x:)
unTagRight _ = id
-
--- | Like 'catMaybes', but for 'Either'.
-collectRights :: [Either _l r] -> [r]
-collectRights = collectNonFailing . untag . spreadChoice . SuccessList
- where untag = fromLeft (error "Unexpected Left")
diff --git a/src/Text/Pandoc/Readers/Odt/Generic/XMLConverter.hs b/src/Text/Pandoc/Readers/Odt/Generic/XMLConverter.hs
index 1c3e08a7f..428048427 100644
--- a/src/Text/Pandoc/Readers/Odt/Generic/XMLConverter.hs
+++ b/src/Text/Pandoc/Readers/Odt/Generic/XMLConverter.hs
@@ -71,6 +71,7 @@ import Control.Applicative hiding ( liftA, liftA2 )
import Control.Monad ( MonadPlus )
import Control.Arrow
+import Data.Either ( rights )
import qualified Data.Map as M
import Data.Default
import Data.Maybe
@@ -604,7 +605,7 @@ tryAll :: (NameSpaceID nsID)
-> XMLConverter nsID extraState b [a]
tryAll nsID name a = prepareIteration nsID name
>>> iterateS (switchingTheStack a)
- >>^ collectRights
+ >>^ rights
--------------------------------------------------------------------------------
-- Matching children