1
1
mirror of https://github.com/github/semantic.git synced 2024-11-23 16:37:50 +03:00

Inline edgeNamed.

This commit is contained in:
Rob Rix 2022-02-03 11:28:30 -05:00
parent cc807c7b95
commit b1660bf2b1
No known key found for this signature in database
GPG Key ID: 2BE643E01DC032AE

View File

@ -168,6 +168,5 @@ parseNode o = do
attrs <- edge A..: pack "attrs"
f sink attrs)
resolve = edge (const . pure . flip (IntMap.!))
edgeNamed name sink attrs = attrs A..: pack "type" >>= guard . (== name) >> pure (IntMap.! sink)
findEdgeNamed name = foldMap (edge (edgeNamed name)) edges
findEdgeNamed name = foldMap (edge (\ sink attrs -> attrs A..: pack "type" >>= guard . (== name) >> pure (IntMap.! sink))) edges
o A..: pack "attrs" >>= A.withObject "attrs" (fmap (index,) . parseType)