-- | Reflexive version of 'upperUntil'
upperUntilRefl :: (Ord a, Ord b, Show a) =>
                  (a -> b -> Bool) -- ^ cut-off predicate
               -> DepGraph a b a -- ^ dependency graph to be traversed
               -> Set.Set a -- ^ compare entries to these elements
               -> Set.Set (a, b)
upperUntilRefl cop gr es
    | Set.null es = Set.empty
    | otherwise =
        Set.union (setFilterLookup (getKey gr) (const $ const True) gr es)
               $ upperUntil cop gr es
upperUntilRefl :: (Ord a, Ord b, Show a) =>
                  (a -> b -> Bool) -- ^ cut-off predicate
               -> DepGraph a b a -- ^ dependency graph to be traversed
               -> Set.Set a -- ^ compare entries to these elements
               -> Set.Set (a, b)
upperUntilRefl cop gr es
    | Set.null es = Set.empty
    | otherwise =
        Set.union (setFilterLookup (getKey gr) (const $ const True) gr es)
               $ upperUntil cop gr es
upperUntilRefl cop gr es
    | Set.null es = Set.empty
    | otherwise =
        Set.union (setFilterLookup (getKey gr) (const $ const True) gr es)
               $ upperUntil cop gr es