Skip to content

Commit

Permalink
don't bother with fold' ghc is smart anyway
Browse files Browse the repository at this point in the history
  • Loading branch information
glguy committed Dec 9, 2024
1 parent 1969393 commit cf0fdee
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions solutions/src/2024/09.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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.
Expand Down

0 comments on commit cf0fdee

Please sign in to comment.