Fix ghc warnings

This commit is contained in:
2024-12-14 11:49:14 +01:00
parent 7cc43b607d
commit b0303fa23d
14 changed files with 51 additions and 36 deletions

View File

@ -1,3 +1,5 @@
import Data.List (uncons)
import Data.Maybe (fromJust)
import Control.Applicative
import qualified Data.Set as Set
@ -30,6 +32,6 @@ main = do
contents <- lines <$> readFile "day8.txt"
let antennas = getAntennas contents
x = length contents
y = length $ head contents
y = length $ fst . fromJust $ uncons contents
antinodes = Set.fromList $ concat [ getAntinodes a b x y | a <- antennas, b <- antennas, a /= b, frequency a == frequency b ]
print $ length antinodes

View File

@ -1,3 +1,5 @@
import Data.List (uncons)
import Data.Maybe (fromJust)
import Control.Applicative
import Data.Set (fromList)
import Data.Bifunctor (bimap)
@ -39,6 +41,6 @@ main = do
contents <- lines <$> readFile "day8.txt"
let antennas = getAntennas contents
x = length contents
y = length $ head contents
y = length $ fst . fromJust $ uncons contents
antinodes = fromList $ concat [ getAntinodes a b x y | a <- antennas, b <- antennas, a /= b, frequency a == frequency b ]
print $ length antinodes