mkOutline tree = fst (mkOutline' emptyOutline 1 headings)
where
headings :: [BlockElement]
- headings = concat (map collectInBlock tree)
+ headings = concatMap collectInBlock tree
collectInBlock :: BlockElement -> [BlockElement]
collectInBlock hd@(Heading _ _)
= [hd]
collectInBlock (Div _ xs)
- = concat $ map collectInBlock $ catMaybes (map castToBlock xs)
+ = concatMap collectInBlock $ catMaybes (map castToBlock xs)
collectInBlock (BlockCmd (BlockCommand _ _ xs))
- = concat $ map collectInBlock xs
+ = concatMap collectInBlock xs
collectInBlock _
= []