mirror of
https://github.com/github/semantic.git
synced 2024-12-20 21:31:48 +03:00
Simplify a bit with ***
rather than &&&
This commit is contained in:
parent
c6766b96a1
commit
eb83f9478d
@ -221,14 +221,14 @@ insertDeclarationScope :: Ord scopeAddress => Declaration -> scopeAddress -> sco
|
|||||||
insertDeclarationScope decl@Declaration{..} associatedScopeAddress scopeAddress g = fromMaybe g $ do
|
insertDeclarationScope decl@Declaration{..} associatedScopeAddress scopeAddress g = fromMaybe g $ do
|
||||||
declScopeAddress <- pathDeclarationScope scopeAddress =<< lookupScopePath unDeclaration scopeAddress g
|
declScopeAddress <- pathDeclarationScope scopeAddress =<< lookupScopePath unDeclaration scopeAddress g
|
||||||
scope <- lookupScope declScopeAddress g
|
scope <- lookupScope declScopeAddress g
|
||||||
(declData, position) <- (fst &&& unPosition . snd) <$> lookupDeclaration unDeclaration declScopeAddress g
|
(declData, position) <- (id *** unPosition) <$> lookupDeclaration unDeclaration declScopeAddress g
|
||||||
pure $ insertScope declScopeAddress (scope { declarations = Seq.adjust (const (Data decl (dataRelation declData) (dataSpan declData) (Just associatedScopeAddress))) position (declarations scope) }) g
|
pure $ insertScope declScopeAddress (scope { declarations = Seq.adjust (const (Data decl (dataRelation declData) (dataSpan declData) (Just associatedScopeAddress))) position (declarations scope) }) g
|
||||||
|
|
||||||
-- | Insert a declaration span into the declaration in the scope graph.
|
-- | Insert a declaration span into the declaration in the scope graph.
|
||||||
insertDeclarationSpan :: Ord scopeAddress => Declaration -> Span -> ScopeGraph scopeAddress -> ScopeGraph scopeAddress
|
insertDeclarationSpan :: Ord scopeAddress => Declaration -> Span -> ScopeGraph scopeAddress -> ScopeGraph scopeAddress
|
||||||
insertDeclarationSpan decl@Declaration{..} span g = fromMaybe g $ do
|
insertDeclarationSpan decl@Declaration{..} span g = fromMaybe g $ do
|
||||||
declScopeAddress <- scopeOfDeclaration decl g
|
declScopeAddress <- scopeOfDeclaration decl g
|
||||||
(declData, position) <- (fst &&& unPosition . snd) <$> lookupDeclaration unDeclaration declScopeAddress g
|
(declData, position) <- (id *** unPosition) <$> lookupDeclaration unDeclaration declScopeAddress g
|
||||||
scope <- lookupScope declScopeAddress g
|
scope <- lookupScope declScopeAddress g
|
||||||
pure $ insertScope declScopeAddress (scope { declarations = Seq.adjust (const (Data decl (dataRelation declData) span (dataAssociatedScope declData))) position (declarations scope) }) g
|
pure $ insertScope declScopeAddress (scope { declarations = Seq.adjust (const (Data decl (dataRelation declData) span (dataAssociatedScope declData))) position (declarations scope) }) g
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user