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.
This commit is contained in:
Joseph C. Sible 2020-02-05 20:22:53 -05:00 committed by GitHub
parent 9c12024e07
commit 30c8980883
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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