X-Git-Url: https://git.njae.me.uk/?a=blobdiff_plain;f=README.md;fp=README.md;h=78f784902e697cbf693ffb83b1427f29474601c0;hb=fbf84930783a435e67f823085f646be0ab8ffd6d;hp=2e4886ca28d1928ef768353217ce845fb803e444;hpb=ba76f268135ad0fb21cca428f88183d246acb520;p=advent-of-code-16.git diff --git a/README.md b/README.md index 2e4886c..78f7849 100644 --- a/README.md +++ b/README.md @@ -7,12 +7,53 @@ Code to solve the [Advent of Code](http://adventofcode.com/2016/) puzzles. This [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. -I'm using the basic Haskell Platform installation (install with +# Toolchain + +I'm using the basic Haskell Platform installation, togeher with `Stack` to manage the packages and dependencies (install with ``` -$ sudo aptitude install haskell-platform +$ sudo aptitude install haskell-platform haskell-stack ``` ). +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. + +Compile with +``` +stack build +``` +or +``` +stack build adventofcode1601 +``` + +Run with +``` +stack exec advent01 +``` + +Run interactively with +``` +stack ghci adventofcode1601:exe:advent01 +``` + +To profile, use +``` +stack build --executable-profiling --library-profiling -ghc-options="-fprof-auto -rtsopts" adventofcode1601 +``` +then run with +``` +stack exec -- advent01 +RTS -p -hy +``` + +# Readme + +Build this readme file wth +``` +pandoc -s README.md > README.html +``` + +### Earlier instructions, for compiling before use of Stack + 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 ``` $ cabal install MissingH @@ -39,9 +80,4 @@ time ./advent01 +RTS -p -hy and create the profile picture with `h2ps advent01.hp` . -Build this readme file wth -``` -pandoc -s README.md > README.html -``` - -(Using the [Modest style](https://github.com/markdowncss/modest).) \ No newline at end of file +(Using the [Modest style](https://github.com/markdowncss/modest).)