aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Krotov <ilabdsf@gmail.com>2018-04-03 16:09:12 +0300
committerAlexander Krotov <ilabdsf@gmail.com>2018-04-03 16:09:12 +0300
commitd6b8d7feb89e335db14d50756ec74bcce7e3e590 (patch)
tree983737df7f94669fde31ae3d344d8945b2f6d932
parent51e8a79023758f4c424d861b0b1aa25578ed62d0 (diff)
downloadpandoc-d6b8d7feb89e335db14d50756ec74bcce7e3e590.tar.gz
Muse reader: rewrite museOrderedListMarker without "do"
-rw-r--r--src/Text/Pandoc/Readers/Muse.hs19
1 files changed, 9 insertions, 10 deletions
diff --git a/src/Text/Pandoc/Readers/Muse.hs b/src/Text/Pandoc/Readers/Muse.hs
index 22f703e7d..158b23ffc 100644
--- a/src/Text/Pandoc/Readers/Muse.hs
+++ b/src/Text/Pandoc/Readers/Muse.hs
@@ -563,16 +563,15 @@ anyMuseOrderedListMarker = do
museOrderedListMarker :: PandocMonad m
=> ListNumberStyle
-> MuseParser m Int
-museOrderedListMarker style = do
- (_, start) <- case style of
- Decimal -> decimal
- UpperRoman -> upperRoman
- LowerRoman -> lowerRoman
- UpperAlpha -> upperAlpha
- LowerAlpha -> lowerAlpha
- _ -> fail "Unhandled case"
- char '.'
- return start
+museOrderedListMarker style =
+ snd <$> p <* char '.'
+ where p = case style of
+ Decimal -> decimal
+ UpperRoman -> upperRoman
+ LowerRoman -> lowerRoman
+ UpperAlpha -> upperAlpha
+ LowerAlpha -> lowerAlpha
+ _ -> fail "Unhandled case"
orderedListItemsUntil :: PandocMonad m
=> Int