Skip to content
This repository was archived by the owner on Apr 1, 2025. It is now read-only.

Commit d1b1d12

Browse files
committed
📝 parseNode.
1 parent b041cec commit d1b1d12

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

semantic-analysis/src/Analysis/Syntax.hs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,9 @@ parseGraph = A.withArray "nodes" $ \ nodes -> do
125125
let tied = fix (\ tied -> ($ Graph tied) <$> untied)
126126
pure (Graph tied, ($ Graph tied) <$> root)
127127

128+
-- | Parse a node from a JSON @Value@ into a pair of a partial graph of unfixed terms and optionally an unfixed term representing the root node.
129+
--
130+
-- The partial graph is represented as an adjacency map relating node IDs to unfixed terms—terms which may make reference to a completed graph to find edges, and which therefore can't be inspected until the full graph is known.
128131
parseNode :: A.Value -> A.Parser (IntMap.IntMap (Graph -> Term), First (Graph -> Term))
129132
parseNode = A.withObject "node" $ \ o -> do
130133
edges <- o A..: fromString "edges"

0 commit comments

Comments
 (0)