From b6b95b9af1d3d8ea27755c2f6832cb61c167312f Mon Sep 17 00:00:00 2001 From: Taylor Date: Tue, 14 Jan 2025 02:55:16 -0600 Subject: [PATCH] comment and strict foldl' --- src/Push.hs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Push.hs b/src/Push.hs index 8e1a1fa..ed3a952 100644 --- a/src/Push.hs +++ b/src/Push.hs @@ -1,5 +1,7 @@ module Push where +import Data.List (foldl') + -- import Debug.Trace (trace, traceStack) -- GeneModular or Gene? @@ -79,6 +81,8 @@ intAdd state = -- this would change Gene to something like GeneModular above. -- Wow, a one-liner for interpreting a paretheses-free genome... +-- Does not handle any data elements in genome yet, +-- but condition could be added to the lambda. -- Need to update this when adding parethetical blocks too. interpretGenome :: State -> [(State -> State)] -> State -interpretGenome state = foldl (\acc f -> f acc) state +interpretGenome state = foldl' (\acc f -> f acc) state