From abd770c691ce09ff74e175f5bd25de2058d3c766 Mon Sep 17 00:00:00 2001 From: Alexander Krotov Date: Fri, 5 Oct 2018 16:27:29 +0300 Subject: Muse reader internals: simplify parseMuse --- src/Text/Pandoc/Readers/Muse.hs | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'src/Text/Pandoc') diff --git a/src/Text/Pandoc/Readers/Muse.hs b/src/Text/Pandoc/Readers/Muse.hs index 8e1f3a2af..aaa9d2eb1 100644 --- a/src/Text/Pandoc/Readers/Muse.hs +++ b/src/Text/Pandoc/Readers/Muse.hs @@ -123,13 +123,9 @@ instance HasLogMessages MuseState where parseMuse :: PandocMonad m => MuseParser m Pandoc parseMuse = do many directive - firstSection <- parseBlocks - rest <- many parseSection - let blocks = mconcat (firstSection : rest) + blocks <- (:) <$> parseBlocks <*> many parseSection st <- getState - let doc = runF (do Pandoc _ bs <- B.doc <$> blocks - meta <- museMeta st - return $ Pandoc meta bs) st + let doc = runF (Pandoc <$> museMeta st <*> fmap B.toList (mconcat blocks)) st reportLogMessages return doc -- cgit v1.2.3