From 12c6450ce872842147b1eba1751a9fc5d7d760d7 Mon Sep 17 00:00:00 2001 From: shu Date: Mon, 9 Dec 2019 20:36:08 +0100 Subject: [PATCH] Day 7: Remove DeepSeq.force MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fascinatingly makes this day slower—by quite a bit. --- 2019/day7/day7.hs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/2019/day7/day7.hs b/2019/day7/day7.hs index a94bf5a..8e8982e 100644 --- a/2019/day7/day7.hs +++ b/2019/day7/day7.hs @@ -2,7 +2,6 @@ import Data.List.Split import qualified Data.List as L import Data.Vector as V import Data.Char -import Control.DeepSeq as DeepSeq data OutAction = Continue | Output | Halt deriving (Enum, Eq, Show) data Mode = Position | Immediate | Relative deriving (Enum, Eq, Show) @@ -67,7 +66,7 @@ step opvec ((t,p),input,output) = case op of where (op,m) = getOpModes opvec params = paramChange m opvec t tm_binop x = new_tm t ((params ! 0) `x` (params ! 1)) - new_tm t x = DeepSeq.force (t // [(V.last opvec, x)],p) + new_tm t x = (t // [(V.last opvec, x)],p) execSteps :: (TuringMachine, [Int], [Int], OutAction) -> (TuringMachine, [Int], [Int], OutAction) execSteps ((t,p),input,output,halt) =