From a88972cf32f11ae0cc26e0d0fe459b1032a9568f Mon Sep 17 00:00:00 2001 From: Rob Rix Date: Tue, 1 Feb 2022 14:33:43 -0500 Subject: [PATCH] Correct ordering. --- semantic-analysis/src/Analysis/Syntax.hs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/semantic-analysis/src/Analysis/Syntax.hs b/semantic-analysis/src/Analysis/Syntax.hs index 284069685..813440d03 100644 --- a/semantic-analysis/src/Analysis/Syntax.hs +++ b/semantic-analysis/src/Analysis/Syntax.hs @@ -41,7 +41,6 @@ import qualified Data.Aeson.Internal as A import qualified Data.Aeson.Parser as A import qualified Data.Aeson.Types as A import qualified Data.ByteString.Lazy as B -import Data.Foldable (foldl') import Data.Function (fix) import qualified Data.IntMap as IntMap import Data.Text (Text, pack, unpack) @@ -161,7 +160,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' (\ r (i, v) -> let_ (nameI i) v (const r)) noop . zip [0..]) . sequenceA <$> traverse resolve edges + "block" -> fmap (foldr (\ (i, v) r -> 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