Add -Wno-x-partial GHC option

This commit is contained in:
germax26 2024-12-04 17:15:59 +11:00
parent 44166e07ec
commit 3234c7963b
Signed by: germax26
SSH Key Fingerprint: SHA256:N3w+8798IMWBt7SYH8G1C0iJlIa2HIIcRCXwILT5FvM
11 changed files with 24 additions and 4 deletions

View File

@ -1,4 +1,4 @@
import Aoc ( aocMain ) import Aoc
parseFile :: [String] -> [Char] parseFile :: [String] -> [Char]
parseFile lines = let [line] = lines in line parseFile lines = let [line] = lines in line

View File

@ -1,3 +1,5 @@
{-# OPTIONS_GHC -Wno-x-partial #-}
import Aoc import Aoc
import Crypto.Hash.MD5 ( hash ) import Crypto.Hash.MD5 ( hash )
import Data.ByteString.Char8 ( pack ) import Data.ByteString.Char8 ( pack )

View File

@ -1,3 +1,5 @@
{-# OPTIONS_GHC -Wno-x-partial #-}
import Aoc import Aoc
part1 :: [String] -> Int part1 :: [String] -> Int

View File

@ -1,3 +1,5 @@
{-# OPTIONS_GHC -Wno-x-partial #-}
import Aoc import Aoc
import Data.List ( group, sort ) import Data.List ( group, sort )
@ -11,4 +13,4 @@ part1 x = (length after40, after40)
part2 :: p -> String -> Int part2 :: p -> String -> Int
part2 _ after40 = length (iterate step after40 !! 10) -- only 10 more needed part2 _ after40 = length (iterate step after40 !! 10) -- only 10 more needed
main = aocMain' single part1 part2 main = aocMain' single part1 part2

View File

@ -1,3 +1,5 @@
{-# OPTIONS_GHC -Wno-x-partial #-}
import Aoc import Aoc
import Data.Char ( ord, chr ) import Data.Char ( ord, chr )
import Data.List ( group, nub ) import Data.List ( group, nub )

View File

@ -1,3 +1,5 @@
{-# OPTIONS_GHC -Wno-x-partial #-}
import Aoc import Aoc
import Data.Char ( isDigit ) import Data.Char ( isDigit )
import Control.Arrow ( first, second ) import Control.Arrow ( first, second )

View File

@ -1,3 +1,5 @@
{-# OPTIONS_GHC -Wno-x-partial #-}
import Aoc import Aoc
import Data.List.Split ( splitOn ) import Data.List.Split ( splitOn )
import Data.List ( nub ) import Data.List ( nub )

View File

@ -1,3 +1,5 @@
{-# OPTIONS_GHC -Wno-x-partial #-}
import Aoc import Aoc
import Data.List ( transpose ) import Data.List ( transpose )
import Data.Bifunctor ( bimap ) import Data.Bifunctor ( bimap )

View File

@ -1,6 +1,8 @@
{-# OPTIONS_GHC -Wno-x-partial #-}
import Aoc
import Data.List ( sort, group ) import Data.List ( sort, group )
import Data.Maybe ( fromMaybe ) import Data.Maybe ( fromMaybe )
import Aoc ( aocMain )
parseFile :: [String] -> ([Int], [Int]) parseFile :: [String] -> ([Int], [Int])
parseFile lines = unzip [(a, b) | line <- lines, let [a, b] = map read $ words line] parseFile lines = unzip [(a, b) | line <- lines, let [a, b] = map read $ words line]

View File

@ -1,4 +1,6 @@
import Aoc ( aocMain ) {-# OPTIONS_GHC -Wno-x-partial #-}
import Aoc
parseFile :: [String] -> [[Int]] parseFile :: [String] -> [[Int]]
parseFile = map (map read . words) parseFile = map (map read . words)

2
aoc.hs
View File

@ -1,3 +1,5 @@
{-# OPTIONS_GHC -Wno-x-partial #-}
module Aoc where module Aoc where
aocMain' :: (Show p, Show a) => ([String] -> p) -> (p -> (a, c)) -> (p -> c -> a) -> IO () aocMain' :: (Show p, Show a) => ([String] -> p) -> (p -> (a, c)) -> (p -> c -> a) -> IO ()