aoc2024

My solutions to the 2024 Advent of Code puzzles
git clone git://git.ethandl.dev/aoc2024
Log | Files | Refs | LICENSE

Main.hs (743B)


      1 module Main (main) where
      2 -- Used jippity 4 to get this cod
      3 
      4 import Test.DocTest (doctest)
      5 import System.Environment (lookupEnv)
      6 
      7 main :: IO ()
      8 main = do
      9     -- Lookup GHC_PACKAGE_PATH from the Cabal environment
     10     mPackagePath <- lookupEnv "GHC_PACKAGE_PATH"
     11     let packageDbOption = case mPackagePath of
     12             Just path -> ["-package-db=" ++ path]
     13             Nothing   -> [] -- Fallback: no package-db specified
     14     -- Run doctest with the appropriate options
     15     doctest $
     16         [ "-isrc"
     17         , "-package=regex-base"
     18         , "-package=regex-tdfa"
     19         , "-package=vector"
     20         , "src/Day1.hs"
     21         , "src/Day2.hs"
     22         , "src/Day3.hs"
     23         , "src/Day4.hs"
     24         , "src/Day5.hs"
     25         ] ++ packageDbOption