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.
20 To work on a project, `cd` into that project's directory.
28 stack build adventofcode1601
36 Run interactively with
38 stack ghci adventofcode1601:exe:advent01
43 stack build --executable-profiling --library-profiling --ghc-options="-fprof-auto -rtsopts" adventofcode1601
47 stack exec -- advent01 +RTS -p -hy
52 Build this readme file wth
54 pandoc -s README.md > README.html
57 ### Earlier instructions, for compiling before use of Stack
59 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
61 $ cabal install MissingH
62 $ cabal install parsec-numbers
63 $ cabal install cryptonite
64 $ cabal install pqueue
69 ghc --make advent01.hs
77 If you're profiling, compile and run with
79 ghc -O2 --make advent01.hs -prof -auto-all -caf-all -fforce-recomp -rstopts
80 time ./advent01 +RTS -p -hy
83 and create the profile picture with `h2ps advent01.hp` .
85 (Using the [Modest style](https://github.com/markdowncss/modest).)