From 7bdcb038790a0c8a4990c10696eda98459280ab8 Mon Sep 17 00:00:00 2001 From: Taylor Date: Wed, 15 Jan 2025 15:39:06 -0600 Subject: [PATCH] pattern matching via destructuring is amazing! --- src/Push.hs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Push.hs b/src/Push.hs index 94e258f..0dcc55a 100644 --- a/src/Push.hs +++ b/src/Push.hs @@ -57,10 +57,10 @@ instructionIntDiv (State es (i1 : i2 : is) fs bs ss ps) = State es (i2 `div` i1 instructionIntDiv state = state instructionExecIf :: State -> State -instructionExecIf (State (e : es) is fs (b : bs) ss ps) = +instructionExecIf (State (e1 : e2 : es) is fs (b : bs) ss ps) = case b of - True -> State (e : drop 1 es) is fs bs ss ps - False -> State (es) is fs bs ss ps + True -> State (e1 : es) is fs bs ss ps + False -> State (e2 : es) is fs bs ss ps instructionExecIf state = state -- This is one of the push genome functions itself, not infrastructure.