Man reader: use mapLeft from Shared.

This commit is contained in:
John MacFarlane 2018-11-29 13:28:43 -08:00
parent cefb0886c3
commit ec07a5298c

View file

@ -49,7 +49,7 @@ import Text.Pandoc.Logging (LogMessage(..))
import Text.Pandoc.Options
import Text.Pandoc.Parsing
import Text.Pandoc.Walk (query)
import Text.Pandoc.Shared (crFilter)
import Text.Pandoc.Shared (crFilter, mapLeft)
import Text.Pandoc.Readers.Roff -- TODO explicit imports
import Text.Parsec hiding (tokenPrim)
import qualified Text.Parsec as Parsec
@ -87,11 +87,6 @@ readWithMTokens parser state input =
let leftF = PandocParsecError . intercalate "\n" $ show <$> input
in mapLeft leftF `liftM` runParserT parser state "source" input
mapLeft :: (a -> c) -> Either a b -> Either c b
mapLeft f (Left x) = Left $ f x
mapLeft _ (Right r) = Right r
parseMan :: PandocMonad m => ManParser m Pandoc
parseMan = do
bs <- many parseBlock <* eof