getCandidates :: (DefStore d, DevGraphNavigator nav) =>
                 d -> nav
                   -> (TypeScheme -> Bool) -- ^ Filter predicate for types
                   -> String -- ^ Name of pattern spec
                   -> String -- ^ Name of concrete spec
                   -> Maybe [[(MatchOp, MatchOp)]]
getCandidates def dgnav tFilter patN cN =
    let
-- g s dgnav' = getInLibEnv dgnav' lookupLocalNodeByName s
        g = getNamedSpec
        f s = fromSearchResult (g s) getLocalSyms dgnav
        mGp = f patN
        mGc = f cN
        pSyms = Set.map gsymToSym $ fromJust mGp
        cSyms = Set.map gsymToSym $ fromJust mGc
        cands = candidates (getDefinition def) tFilter pSyms cSyms
    in if isJust mGp && isJust mGc then Just cands else Nothing
getCandidates :: (DefStore d, DevGraphNavigator nav) =>
                 d -> nav
                   -> (TypeScheme -> Bool) -- ^ Filter predicate for types
                   -> String -- ^ Name of pattern spec
                   -> String -- ^ Name of concrete spec
                   -> Maybe [[(MatchOp, MatchOp)]]
getCandidates def dgnav tFilter patN cN =
    let
-- g s dgnav' = getInLibEnv dgnav' lookupLocalNodeByName s
        g = getNamedSpec
        f s = fromSearchResult (g s) getLocalSyms dgnav
        mGp = f patN
        mGc = f cN
        pSyms = Set.map gsymToSym $ fromJust mGp
        cSyms = Set.map gsymToSym $ fromJust mGc
        cands = candidates (getDefinition def) tFilter pSyms cSyms
    in if isJust mGp && isJust mGc then Just cands else Nothing
getCandidates def dgnav tFilter patN cN =
    let
-- g s dgnav' = getInLibEnv dgnav' lookupLocalNodeByName s
        g = getNamedSpec
        f s = fromSearchResult (g s) getLocalSyms dgnav
        mGp = f patN
        mGc = f cN
        pSyms = Set.map gsymToSym $ fromJust mGp
        cSyms = Set.map gsymToSym $ fromJust mGc
        cands = candidates (getDefinition def) tFilter pSyms cSyms
    in if isJust mGp && isJust mGc then Just cands else Nothing