From 30c8980883921e0672c36db2ad77ab31c147190c Mon Sep 17 00:00:00 2001 From: "Joseph C. Sible" Date: Wed, 5 Feb 2020 20:22:53 -0500 Subject: Simplify an overcomplicated filtering function (#6115) There's no need to use `catMaybes`, `uncurry`, `bool`, etc., just to get elements where the second element of a tuple is True. --- src/Text/Pandoc/Readers/Odt/Generic/XMLConverter.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/Text/Pandoc/Readers/Odt/Generic') diff --git a/src/Text/Pandoc/Readers/Odt/Generic/XMLConverter.hs b/src/Text/Pandoc/Readers/Odt/Generic/XMLConverter.hs index 796026843..6949da9d8 100644 --- a/src/Text/Pandoc/Readers/Odt/Generic/XMLConverter.hs +++ b/src/Text/Pandoc/Readers/Odt/Generic/XMLConverter.hs @@ -390,7 +390,7 @@ filterChildrenName' :: (NameSpaceID nsID) filterChildrenName' nsID f = getCurrentElement >>> arr XML.elChildren >>> iterateS (keepingTheValue (elemNameMatches nsID f)) - >>> arr (catMaybes . fmap (uncurry $ bool Nothing . Just)) + >>> arr (map fst . filter snd) -------------------------------------------------------------------------------- -- Attributes -- cgit v1.2.3