git.iko.soy/typeable/pandoc
on master help sign in
Org reader: replace `sequence . map` with `mapM`
602cd6aAlbert Krewinkel
src/Text/Pandoc/Readers/Org/Blocks.hs+1−1
@@ -65,7 +65,7 @@ blockList = do
65 initialBlocks <- blocks
65 initialBlocks <- blocks
66 headlines <- sequence <$> manyTill (headline blocks inline 1) eof
66 headlines <- sequence <$> manyTill (headline blocks inline 1) eof
67 st <- getState
67 st <- getState
68− headlineBlocks <- fmap mconcat . sequence . map headlineToBlocks $ runF headlines st
68+ headlineBlocks <- fmap mconcat . mapM headlineToBlocks $ runF headlines st
69 return . B.toList $ (runF initialBlocks st) <> headlineBlocks
69 return . B.toList $ (runF initialBlocks st) <> headlineBlocks
70
70
71-- | Get the meta information saved in the state.
71-- | Get the meta information saved in the state.
src/Text/Pandoc/Readers/Org/DocumentTree.hs+2−2
@@ -164,7 +164,7 @@ headlineToHeaderWithList :: Monad m => Headline -> OrgParser m Blocks
164headlineToHeaderWithList hdln@(Headline {..}) = do
164headlineToHeaderWithList hdln@(Headline {..}) = do
165 maxHeadlineLevels <- getExportSetting exportHeadlineLevels
165 maxHeadlineLevels <- getExportSetting exportHeadlineLevels
166 header <- headlineToHeader hdln
166 header <- headlineToHeader hdln
167− listElements <- sequence (map headlineToBlocks headlineChildren)
167+ listElements <- mapM headlineToBlocks headlineChildren
168 let listBlock = if null listElements
168 let listBlock = if null listElements
169 then mempty
169 then mempty
170 else B.orderedList listElements
170 else B.orderedList listElements
@@ -182,7 +182,7 @@ headlineToHeaderWithList hdln@(Headline {..}) = do
182headlineToHeaderWithContents :: Monad m => Headline -> OrgParser m Blocks
182headlineToHeaderWithContents :: Monad m => Headline -> OrgParser m Blocks
183headlineToHeaderWithContents hdln@(Headline {..}) = do
183headlineToHeaderWithContents hdln@(Headline {..}) = do
184 header <- headlineToHeader hdln
184 header <- headlineToHeader hdln
185− childrenBlocks <- mconcat <$> sequence (map headlineToBlocks headlineChildren)
185+ childrenBlocks <- mconcat <$> mapM headlineToBlocks headlineChildren
186 return $ header <> headlineContents <> childrenBlocks
186 return $ header <> headlineContents <> childrenBlocks
187
187
188headlineToHeader :: Monad m => Headline -> OrgParser m Blocks
188headlineToHeader :: Monad m => Headline -> OrgParser m Blocks