Solve 2023-04
This commit is contained in:
parent
ea76aecceb
commit
b3bb19f38d
9 changed files with 469 additions and 154 deletions
|
|
@ -3,6 +3,9 @@ module AoC.Riddle (
|
|||
Error,
|
||||
Solution,
|
||||
loadRiddle,
|
||||
loadExample,
|
||||
module AoC.Day,
|
||||
module AoC.Year,
|
||||
) where
|
||||
|
||||
import AoC.Util (readFileUtf8)
|
||||
|
|
@ -15,6 +18,12 @@ type Error = Text
|
|||
type Solution = [Integer]
|
||||
|
||||
loadRiddle :: (MonadIO m) => Year -> Day -> m Riddle
|
||||
loadRiddle y d = readFileUtf8 inputFile
|
||||
loadRiddle = loadFile "riddle"
|
||||
|
||||
loadExample :: (MonadIO m) => Year -> Day -> m Riddle
|
||||
loadExample = loadFile "example"
|
||||
|
||||
loadFile :: (MonadIO m) => FilePath -> Year -> Day -> m Riddle
|
||||
loadFile f y d = readFileUtf8 inputFile
|
||||
where
|
||||
inputFile = intercalate "/" ["data", show y, show d, "riddle"]
|
||||
inputFile = intercalate "/" ["data", show y, show d, f]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue