My solutions for AOC 2021, AOC 2022 and AOC 2024!
I'm using this to learn Haskell and purely functional programming in general. Because of that i always try to stick to the immutable solutions before falling back to using the ST or IO Monad.
- 2021:
1..22 - 2022:
1..25 - 2024:
1..11
cabal run aoc -- 2022 17 twoThe solution to every day is in its own module and exports two functions, one for either part of the problem.
Both functions always have the same signature.
partOne :: String -> Either String String
partTwo :: String -> Either String StringSee 2022/Day1.hs for an example of this.
The Main module then just has to pick the right function from the list of days, depending on the CLI arguments, and apply it to the input.
docker build -t aoc . && docker run --rm -v $(pwd):/app aoc