1
1
mirror of https://github.com/github/semantic.git synced 2024-11-30 14:47:30 +03:00

Give a signature for findEdgeNamed.

This commit is contained in:
Rob Rix 2022-02-07 15:01:52 -05:00
parent 3c9736763d
commit 47084da3d0
No known key found for this signature in database
GPG Key ID: 2BE643E01DC032AE

View File

@ -173,6 +173,7 @@ parseNode o = do
attrs <- edge A..: pack "attrs"
f attrs
pure (IntMap.! sink))
findEdgeNamed :: (A.FromJSON a, Eq a) => a -> A.Parser (IntMap.IntMap rep -> rep)
findEdgeNamed name = foldMap (resolveWith (\ attrs -> attrs A..: pack "type" >>= guard . (== name))) edges
o A..: pack "attrs" >>= A.withObject "attrs" (\ attrs -> do
ty <- attrs A..: pack "type"