X-Git-Url: https://git.njae.me.uk/?a=blobdiff_plain;ds=sidebyside;f=README.html;h=b78056214e61df38daee4f4a02e20a3a7b02ddbb;hb=HEAD;hp=754e9be307265ae2d03a10941cbb19667d976dea;hpb=fef438e522205404e0e765414e412ccacc34bfaa;p=advent-of-code-16.git diff --git a/README.html b/README.html index 754e9be..b780562 100644 --- a/README.html +++ b/README.html @@ -14,18 +14,41 @@
Code to solve the Advent of Code puzzles. This year, I'm trying to use the puzzles as a prompt to learn Haskell.
Learn you a Haskell, Introduction to Haskell 98, and Hackage are good resources.
-I'm using the basic Haskell Platform installation (install with
-$ sudo aptitude install haskell-platform
+I'm using the basic Haskell Platform installation, togeher with Stack
to manage the packages and dependencies (install with
$ sudo aptitude install haskell-platform haskell-stack
).
-I'm also using the MissingH
library (install with
$ cabal install MissingH
-)
+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.
To work on a project, cd
into that project's directory.
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
+Build this readme file wth
+pandoc -s README.md > README.html
+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
+$ cabal install parsec-numbers
+$ cabal install cryptonite
+$ cabal install pqueue
Compile the code with
ghc --make advent01.hs
then run it as
advent01
-Build this readme file wth
-pandoc -s README.md > README.html
-(Using the Modest styles.)
+If you're profiling, compile and run with
+ghc -O2 --make advent01.hs -prof -auto-all -caf-all -fforce-recomp -rstopts
+time ./advent01 +RTS -p -hy
+and create the profile picture with h2ps advent01.hp
.
(Using the Modest style.)