searchLinkFrom :: DevGraphNavigator a => (LEdge DGLinkLab -> Bool) -> a
                  -> Node -> Maybe (a, LEdge DGLinkLab)
searchLinkFrom p dgnav n =
    let (dgnav', _, ledgs) = followIncoming dgnav n
    in case find p ledgs of
         Nothing -> firstMaybe (searchLinkFrom p dgnav') $ map linkSource ledgs
         x -> fmap ((,) dgnav') x

-- * Predicates to be used with 'searchNode'

-- | This predicate is true for nodes with a nodename equal to the given string
searchLinkFrom :: DevGraphNavigator a => (LEdge DGLinkLab -> Bool) -> a
                  -> Node -> Maybe (a, LEdge DGLinkLab)
searchLinkFrom p dgnav n =
    let (dgnav', _, ledgs) = followIncoming dgnav n
    in case find p ledgs of
         Nothing -> firstMaybe (searchLinkFrom p dgnav') $ map linkSource ledgs
         x -> fmap ((,) dgnav') x

-- * Predicates to be used with 'searchNode'

-- | This predicate is true for nodes with a nodename equal to the given string
searchLinkFrom p dgnav n =
    let (dgnav', _, ledgs) = followIncoming dgnav n
    in case find p ledgs of
         Nothing -> firstMaybe (searchLinkFrom p dgnav') $ map linkSource ledgs
         x -> fmap ((,) dgnav') x

-- * Predicates to be used with 'searchNode'

-- | This predicate is true for nodes with a nodename equal to the given string