mkBSReaderWithWarnings :: (ReaderOptions -> BL.ByteString -> Either PandocError (Pandoc, MediaBag, [String])) -> Reader
mkBSReaderWithWarnings r = ByteStringReader $ \o s ->
  case r o s of
    Left err -> return $ Left err
    Right (doc, mediaBag, warnings) -> do
      mapM_ warn warnings
      return $ Right (doc, mediaBag)

-- | Association list of formats and readers.
mkBSReaderWithWarnings :: (ReaderOptions -> BL.ByteString -> Either PandocError (Pandoc, MediaBag, [String])) -> Reader
mkBSReaderWithWarnings r = ByteStringReader $ \o s ->
  case r o s of
    Left err -> return $ Left err
    Right (doc, mediaBag, warnings) -> do
      mapM_ warn warnings
      return $ Right (doc, mediaBag)

-- | Association list of formats and readers.
mkBSReaderWithWarnings r = ByteStringReader $ \o s ->
  case r o s of
    Left err -> return $ Left err
    Right (doc, mediaBag, warnings) -> do
      mapM_ warn warnings
      return $ Right (doc, mediaBag)

-- | Association list of formats and readers.