Get rid of mapLeft in Muse reader

This commit is contained in:
Alexander Krotov 2018-10-09 18:26:50 +03:00
parent ca1624daa2
commit 4d9ccb163e

View file

@ -60,7 +60,7 @@ import Text.Pandoc.Error (PandocError (PandocParsecError))
import Text.Pandoc.Logging
import Text.Pandoc.Options
import Text.Pandoc.Parsing hiding (F, enclosed)
import Text.Pandoc.Shared (crFilter, underlineSpan, mapLeft)
import Text.Pandoc.Shared (crFilter, underlineSpan)
-- | Read Muse from an input string and return a Pandoc document.
readMuse :: PandocMonad m
@ -69,9 +69,9 @@ readMuse :: PandocMonad m
-> m Pandoc
readMuse opts s = do
let input = crFilter s
res <- mapLeft (PandocParsecError $ unpack input) `liftM` runReaderT (runParserT parseMuse def{ museOptions = opts } "source" input) def
res <- runReaderT (runParserT parseMuse def{ museOptions = opts } "source" input) def
case res of
Left e -> throwError e
Left e -> throwError $ PandocParsecError (unpack input) e
Right d -> return d
type F = Future MuseState