From 0b5562c0fa6aa82a190c742b3969b1299903f7f5 Mon Sep 17 00:00:00 2001 From: Rob Rix Date: Tue, 1 Feb 2022 14:31:36 -0500 Subject: [PATCH] Correct associativity. --- semantic-analysis/src/Analysis/Syntax.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/semantic-analysis/src/Analysis/Syntax.hs b/semantic-analysis/src/Analysis/Syntax.hs index 0612d9c44..284069685 100644 --- a/semantic-analysis/src/Analysis/Syntax.hs +++ b/semantic-analysis/src/Analysis/Syntax.hs @@ -161,7 +161,7 @@ parseNode o = do "false" -> pure (const (bool False)) "throw" -> fmap throw <$> resolve (head edges) "if" -> liftA3 iff <$> findEdge (edgeNamed "condition") <*> findEdge (edgeNamed "consequence") <*> findEdge (edgeNamed "alternative") <|> pure (const noop) - "block" -> fmap (foldl' (\ l (i, r) -> let_ (nameI i) l (const r)) noop . zip [0..]) . sequenceA <$> traverse resolve edges + "block" -> fmap (foldl' (\ r (i, v) -> let_ (nameI i) v (const r)) noop . zip [0..]) . sequenceA <$> traverse resolve edges t -> A.parseFail ("unrecognized type: " <> t) edge :: (IntMap.Key -> A.Object -> A.Parser a) -> A.Value -> A.Parser a edge f = A.withObject "edge" (\ edge -> do