From 3234c7963b88bf23f1e5903e80baac62240f24f6 Mon Sep 17 00:00:00 2001 From: germax26 Date: Wed, 4 Dec 2024 17:15:59 +1100 Subject: [PATCH] Add -Wno-x-partial GHC option --- 2015/day01/day01.hs | 2 +- 2015/day04/day04.hs | 2 ++ 2015/day08/day08.hs | 2 ++ 2015/day10/day10.hs | 4 +++- 2015/day11/day11.hs | 2 ++ 2015/day12/day12.hs | 2 ++ 2015/day13/day13.hs | 2 ++ 2015/day15/day15.hs | 2 ++ 2024/day01/day01.hs | 4 +++- 2024/day02/day02.hs | 4 +++- aoc.hs | 2 ++ 11 files changed, 24 insertions(+), 4 deletions(-) diff --git a/2015/day01/day01.hs b/2015/day01/day01.hs index 4c98e2b..7f84a49 100644 --- a/2015/day01/day01.hs +++ b/2015/day01/day01.hs @@ -1,4 +1,4 @@ -import Aoc ( aocMain ) +import Aoc parseFile :: [String] -> [Char] parseFile lines = let [line] = lines in line diff --git a/2015/day04/day04.hs b/2015/day04/day04.hs index 43a74fa..e19631c 100644 --- a/2015/day04/day04.hs +++ b/2015/day04/day04.hs @@ -1,3 +1,5 @@ +{-# OPTIONS_GHC -Wno-x-partial #-} + import Aoc import Crypto.Hash.MD5 ( hash ) import Data.ByteString.Char8 ( pack ) diff --git a/2015/day08/day08.hs b/2015/day08/day08.hs index e1371d4..7d374ac 100644 --- a/2015/day08/day08.hs +++ b/2015/day08/day08.hs @@ -1,3 +1,5 @@ +{-# OPTIONS_GHC -Wno-x-partial #-} + import Aoc part1 :: [String] -> Int diff --git a/2015/day10/day10.hs b/2015/day10/day10.hs index 0d750cd..4e3ab23 100644 --- a/2015/day10/day10.hs +++ b/2015/day10/day10.hs @@ -1,3 +1,5 @@ +{-# OPTIONS_GHC -Wno-x-partial #-} + import Aoc import Data.List ( group, sort ) @@ -11,4 +13,4 @@ part1 x = (length after40, after40) part2 :: p -> String -> Int part2 _ after40 = length (iterate step after40 !! 10) -- only 10 more needed -main = aocMain' single part1 part2 \ No newline at end of file +main = aocMain' single part1 part2 diff --git a/2015/day11/day11.hs b/2015/day11/day11.hs index a9a97ba..687e478 100644 --- a/2015/day11/day11.hs +++ b/2015/day11/day11.hs @@ -1,3 +1,5 @@ +{-# OPTIONS_GHC -Wno-x-partial #-} + import Aoc import Data.Char ( ord, chr ) import Data.List ( group, nub ) diff --git a/2015/day12/day12.hs b/2015/day12/day12.hs index 8a690f3..74cee3b 100644 --- a/2015/day12/day12.hs +++ b/2015/day12/day12.hs @@ -1,3 +1,5 @@ +{-# OPTIONS_GHC -Wno-x-partial #-} + import Aoc import Data.Char ( isDigit ) import Control.Arrow ( first, second ) diff --git a/2015/day13/day13.hs b/2015/day13/day13.hs index 36389c7..4356864 100644 --- a/2015/day13/day13.hs +++ b/2015/day13/day13.hs @@ -1,3 +1,5 @@ +{-# OPTIONS_GHC -Wno-x-partial #-} + import Aoc import Data.List.Split ( splitOn ) import Data.List ( nub ) diff --git a/2015/day15/day15.hs b/2015/day15/day15.hs index cc33c31..e70e71d 100644 --- a/2015/day15/day15.hs +++ b/2015/day15/day15.hs @@ -1,3 +1,5 @@ +{-# OPTIONS_GHC -Wno-x-partial #-} + import Aoc import Data.List ( transpose ) import Data.Bifunctor ( bimap ) diff --git a/2024/day01/day01.hs b/2024/day01/day01.hs index 74a112c..2c1bd12 100644 --- a/2024/day01/day01.hs +++ b/2024/day01/day01.hs @@ -1,6 +1,8 @@ +{-# OPTIONS_GHC -Wno-x-partial #-} + +import Aoc import Data.List ( sort, group ) import Data.Maybe ( fromMaybe ) -import Aoc ( aocMain ) parseFile :: [String] -> ([Int], [Int]) parseFile lines = unzip [(a, b) | line <- lines, let [a, b] = map read $ words line] diff --git a/2024/day02/day02.hs b/2024/day02/day02.hs index ac0cf0d..19c8342 100644 --- a/2024/day02/day02.hs +++ b/2024/day02/day02.hs @@ -1,4 +1,6 @@ -import Aoc ( aocMain ) +{-# OPTIONS_GHC -Wno-x-partial #-} + +import Aoc parseFile :: [String] -> [[Int]] parseFile = map (map read . words) diff --git a/aoc.hs b/aoc.hs index 01c62ad..0fda65e 100644 --- a/aoc.hs +++ b/aoc.hs @@ -1,3 +1,5 @@ +{-# OPTIONS_GHC -Wno-x-partial #-} + module Aoc where aocMain' :: (Show p, Show a) => ([String] -> p) -> (p -> (a, c)) -> (p -> c -> a) -> IO ()