Org reader: replace sequence . map
with mapM
This commit is contained in:
parent
a27e2e8a4e
commit
602cd6a327
2 changed files with 3 additions and 3 deletions
|
@ -65,7 +65,7 @@ blockList = do
|
|||
initialBlocks <- blocks
|
||||
headlines <- sequence <$> manyTill (headline blocks inline 1) eof
|
||||
st <- getState
|
||||
headlineBlocks <- fmap mconcat . sequence . map headlineToBlocks $ runF headlines st
|
||||
headlineBlocks <- fmap mconcat . mapM headlineToBlocks $ runF headlines st
|
||||
return . B.toList $ (runF initialBlocks st) <> headlineBlocks
|
||||
|
||||
-- | Get the meta information saved in the state.
|
||||
|
|
|
@ -164,7 +164,7 @@ headlineToHeaderWithList :: Monad m => Headline -> OrgParser m Blocks
|
|||
headlineToHeaderWithList hdln@(Headline {..}) = do
|
||||
maxHeadlineLevels <- getExportSetting exportHeadlineLevels
|
||||
header <- headlineToHeader hdln
|
||||
listElements <- sequence (map headlineToBlocks headlineChildren)
|
||||
listElements <- mapM headlineToBlocks headlineChildren
|
||||
let listBlock = if null listElements
|
||||
then mempty
|
||||
else B.orderedList listElements
|
||||
|
@ -182,7 +182,7 @@ headlineToHeaderWithList hdln@(Headline {..}) = do
|
|||
headlineToHeaderWithContents :: Monad m => Headline -> OrgParser m Blocks
|
||||
headlineToHeaderWithContents hdln@(Headline {..}) = do
|
||||
header <- headlineToHeader hdln
|
||||
childrenBlocks <- mconcat <$> sequence (map headlineToBlocks headlineChildren)
|
||||
childrenBlocks <- mconcat <$> mapM headlineToBlocks headlineChildren
|
||||
return $ header <> headlineContents <> childrenBlocks
|
||||
|
||||
headlineToHeader :: Monad m => Headline -> OrgParser m Blocks
|
||||
|
|
Loading…
Add table
Reference in a new issue