git.iko.soy/typeable/pandoc
on master help sign in
RST reader: removed now unnecessary lifts.
commit7d21238d62e51fd7b36b50759324a6b18f11adc5 authorJohn MacFarlane <jgm@berkeley.edu> dateMon 5 Dec 2016, 11:47 (10 years ago) parent931528d
1 file changed+7−8
src/Text/Pandoc/Readers/RST.hs+7−8
src/Text/Pandoc/Readers/RST.hs+7−8
@@ -50,7 +50,6 @@ import Data.Sequence (viewr, ViewR(..))
5050import Data.Char (toLower, isHexDigit, isSpace)
5151import Data.Monoid ((<>))
5252import Control.Monad.Except (throwError, catchError)
53−import Control.Monad.Trans (lift)
5453import Text.Pandoc.Class (PandocMonad, warning, readFileLazy)
5554import qualified Text.Pandoc.Class as P
5655
@@ -423,11 +422,11 @@ include = try $ do
423422 when (f `elem` containers) $
424423 throwError $ PandocParseError $ "Include file loop at " ++ show oldPos
425424 updateState $ \s -> s{ stateContainers = f : stateContainers s }
426− res <- lift $ readFileLazy' f
425+ res <- readFileLazy' f
427426 contents <- case res of
428427 Right x -> return x
429428 Left _e -> do
430− lift $ warning $ "Could not read include file " ++ f ++ "."
429+ warning $ "Could not read include file " ++ f ++ "."
431430 return ""
432431 let contentLines = lines contents
433432 let numLines = length contentLines
@@ -724,20 +723,20 @@ addNewRole roleString fields = do
724723
725724 -- warn about syntax we ignore
726725 flip mapM_ fields $ \(key, _) -> case key of
727− "language" -> when (baseRole /= "code") $ lift $ P.warning $
726+ "language" -> when (baseRole /= "code") $ P.warning $
728727 "ignoring :language: field because the parent of role :" ++
729728 role ++ ": is :" ++ baseRole ++ ": not :code:"
730− "format" -> when (baseRole /= "raw") $ lift $ P.warning $
729+ "format" -> when (baseRole /= "raw") $ P.warning $
731730 "ignoring :format: field because the parent of role :" ++
732731 role ++ ": is :" ++ baseRole ++ ": not :raw:"
733− _ -> lift $ P.warning $ "ignoring unknown field :" ++ key ++
732+ _ -> P.warning $ "ignoring unknown field :" ++ key ++
734733 ": in definition of role :" ++ role ++ ": in"
735734 when (parentRole == "raw" && countKeys "format" > 1) $
736− lift $ P.warning $
735+ P.warning $
737736 "ignoring :format: fields after the first in the definition of role :"
738737 ++ role ++": in"
739738 when (parentRole == "code" && countKeys "language" > 1) $
740− lift $ P.warning $
739+ P.warning $
741740 "ignoring :language: fields after the first in the definition of role :"
742741 ++ role ++": in"
743742