Advent of Code 2019
These are my Advent of Code 2019 solutions. I try to focus on making clean and documented Haskell solutions to each puzzle.
I recommend installing
$ curl https://get-ghcup.haskell.org -sSf | sh
GHC 8.8.1 this year
$ ghcup install 8.8.1 $ ghcup set 8.8.1
cabal-install-3 is the best way to get things built
$ cabal update $ cabal build
All the solutions take an optional command line argument that can be an input file name or
- to read the input from
$ cabal run Day01 ... 3188480 4779847
A few of my solutions rely on a common Intcode interpreter: Intcode.hs
Common libraries used
- containers - Almost all of the solutions will benefit from having access to
Settypes from this package.
- megaparsec - Each problem features a simple text-file format input. Parser combinators make it easy to define the simple parser needed to consume these inputs.
- doctest - Having checked examples in the documentation makes it easier to understand what code does and easy to add unit tests.