From cf0fdee9cdab75a3b774d14d0cc7390b35de5f40 Mon Sep 17 00:00:00 2001 From: Eric Mertens Date: Mon, 9 Dec 2024 10:37:06 -0800 Subject: [PATCH] don't bother with fold' ghc is smart anyway --- solutions/src/2024/09.hs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/solutions/src/2024/09.hs b/solutions/src/2024/09.hs index 37866f3..a3e54e9 100644 --- a/solutions/src/2024/09.hs +++ b/solutions/src/2024/09.hs @@ -24,7 +24,6 @@ module Main (main) where import Advent (getInputLines) import Data.Array.Unboxed (UArray, (!), listArray) import Data.Char (digitToInt) -import Data.Foldable (foldl') import Data.Map (Map) import Data.Map qualified as Map @@ -99,7 +98,7 @@ decFree files free nextId nextOff = \case -- | Move all the files high-to-low to the lowest available contiguous -- free block. moveAll :: [(Int, Int, Int)] -> [(Int, Int)] -> Int -moveAll files free = fst (foldl' move1 (0, Map.fromList free) files) +moveAll files free = fst (foldl move1 (0, Map.fromList free) files) -- | Given the file and free maps try to move the file to the lowest address -- contiguous free block.