1
1
mirror of https://github.com/github/semantic.git synced 2024-12-20 21:31:48 +03:00

Factor out lambda

This commit is contained in:
joshvera 2018-12-14 17:07:13 -05:00
parent 0281016356
commit 69e0e13b1f

View File

@ -266,7 +266,8 @@ scopeOfDeclaration Declaration{..} g@(ScopeGraph graph) = go (Map.keys graph)
associatedScope :: Ord scope => Declaration -> ScopeGraph scope -> Maybe scope associatedScope :: Ord scope => Declaration -> ScopeGraph scope -> Maybe scope
associatedScope Declaration{..} g@(ScopeGraph graph) = go (Map.keys graph) associatedScope Declaration{..} g@(ScopeGraph graph) = go (Map.keys graph)
where where
go = foldr (\ scope -> ((lookupDeclaration unDeclaration scope g >>= dataAssociatedScope . fst) <|>)) Nothing go = foldr lookupAssociatedScope Nothing
lookupAssociatedScope scope = ((lookupDeclaration unDeclaration scope g >>= dataAssociatedScope . fst) <|>)
newtype Reference = Reference { unReference :: Name } newtype Reference = Reference { unReference :: Name }
deriving (Eq, Ord, Show, Generic, NFData) deriving (Eq, Ord, Show, Generic, NFData)