2 title: "Advent of Code 2016"
6 Code to solve the [Advent of Code](http://adventofcode.com/2016/) puzzles. This year, I'm trying to use the puzzles as a prompt to learn [Haskell](https://wiki.haskell.org/Haskell).
8 [Learn you a Haskell](http://learnyouahaskell.com/chapters), [Introduction to Haskell 98](https://www.haskell.org/tutorial/index.html), and [Hackage](https://hackage.haskell.org/) are good resources.
12 I'm using the basic Haskell Platform installation, togeher with `Stack` to manage the packages and dependencies (install with
14 $ sudo aptitude install haskell-platform haskell-stack
18 I have one package for each day, to save time waiting for Stack to check every executable before compiling what's changed. Each package needs a separate directory tree and a separate `.cabal` file.
26 stack build adventofcode1601
34 Run interactively with
36 stack ghci adventofcode1601:exe:advent01
41 stack build --executable-profiling --library-profiling -ghc-options="-fprof-auto -rtsopts" adventofcode1601
45 stack exec -- advent01 +RTS -p -hy
50 Build this readme file wth
52 pandoc -s README.md > README.html
55 ### Earlier instructions, for compiling before use of Stack
57 I'm also using some extra libraries. Before installing, run `cabal update` then set `library-profiling: True` in `~/.cabal/config` . Then install the packages with
59 $ cabal install MissingH
60 $ cabal install parsec-numbers
61 $ cabal install cryptonite
62 $ cabal install pqueue
67 ghc --make advent01.hs
75 If you're profiling, compile and run with
77 ghc -O2 --make advent01.hs -prof -auto-all -caf-all -fforce-recomp -rstopts
78 time ./advent01 +RTS -p -hy
81 and create the profile picture with `h2ps advent01.hp` .
83 (Using the [Modest style](https://github.com/markdowncss/modest).)