entrytree_clear_tags :: Entry a => [EntryTree a] -> Maybe [EntryTree a]
entrytree_clear_tags et =
    entrytree_map_maybe f et
    where
        f e Nothing _ =
            case entrytree_tagged e of
                False -> Nothing
                True -> Just [e{entrytree_tagged=False}]
        f e (Just nch) _ =
            Just [e{entrytree_tagged=False, entrytree_children=nch}]
entrytree_clear_tags :: Entry a => [EntryTree a] -> Maybe [EntryTree a]
entrytree_clear_tags et =
    entrytree_map_maybe f et
    where
        f e Nothing _ =
            case entrytree_tagged e of
                False -> Nothing
                True -> Just [e{entrytree_tagged=False}]
        f e (Just nch) _ =
            Just [e{entrytree_tagged=False, entrytree_children=nch}]
entrytree_clear_tags et =
    entrytree_map_maybe f et
    where
        f e Nothing _ =
            case entrytree_tagged e of
                False -> Nothing
                True -> Just [e{entrytree_tagged=False}]
        f e (Just nch) _ =
            Just [e{entrytree_tagged=False, entrytree_children=nch}]