mirror of
https://github.com/github/semantic.git
synced 2024-11-27 12:57:49 +03:00
Factor out a resolveWith function.
This commit is contained in:
parent
b1660bf2b1
commit
2e5d6160f6
@ -167,6 +167,7 @@ parseNode o = do
|
||||
sink <- edge A..: pack "sink"
|
||||
attrs <- edge A..: pack "attrs"
|
||||
f sink attrs)
|
||||
resolve = edge (const . pure . flip (IntMap.!))
|
||||
resolve = resolveWith (const (pure ()))
|
||||
resolveWith f = edge (\ sink attrs -> f attrs >> pure (IntMap.! sink))
|
||||
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)
|
||||
|
Loading…
Reference in New Issue
Block a user