Tweaked some parsing code
[advent-of-code-21.git] / README.md
index f7151b3343de5e14b7c2d78cb9195d5d8fb49c8a..17a29027d617b15661d148015f2033e6a0517413 100644 (file)
--- a/README.md
+++ b/README.md
@@ -7,8 +7,7 @@ Code to solve the [Advent of Code](http://adventofcode.com/2020/) 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.
 
-The [Stack documentation](https://docs.haskellstack.org/en/stable/README/) and [How I Start: Haskell](http://howistart.org/posts/haskell/1/) are good sources of using the tools. 
-
+The [Cabal user guide](https://cabal.readthedocs.io/en/latest/index.html) and [How I Start: Haskell](http://howistart.org/posts/haskell/1/) are good sources of using the tools. 
 
 # Toolchain
 
@@ -38,7 +37,7 @@ Modify the `advent-of-code21.cabal` file as needed, such as updating the Cabal v
 
 ## Creating subsequent days
 
-Each day lives in a separate directory, with its own `package.yaml` file and code in the `src` directory. (I based this configuration from [mstksg's setup](https://github.com/mstksg/advent-of-code-2018).)
+Each day lives in a separate directory, with code in the `src` directory. 
 
 Compile with
 ```
@@ -56,7 +55,7 @@ cabal run advent01
 
 If you want to pass in additional RTS parameters, do it like this:
 ```
-stack exec -- advent01 +RTS -K0 -RTS
+cabal run advent01 -- +RTS -K0 -RTS
 ```
 
 Run interactively with
@@ -69,26 +68,42 @@ stack ghci advent01:exe:advent01
 ```
 if the first form is ambiguous. 
 
+## Profiling
+
 To profile, use 
+
 ```
-stack build --executable-profiling --library-profiling --ghc-options="-fprof-auto -rtsopts" advent01
+cabal run advent01 --enable-profiling -- +RTS -N -p -s -hT
 ```
-then run with
+
+Or, you can simplify the RTS options by adding them to a new stanza in the cabal file:
+
 ```
-stack exec --profile -- advent01 +RTS -p -hy
+executable advent01prof
+  import: common-extensions, build-directives
+  main-is: advent01/Main.hs
+  build-depends: text, containers, linear, array, pqueue, mtl, lens
+  ghc-options:         -O2 
+                       -Wall 
+                       -threaded 
+                       -rtsopts "-with-rtsopts=-N -p -s -hT"
 ```
-Generate the profile graph with
+
+then running 
+
 ```
-stack exec hp2ps advent01.hp
+cabal run advent01prof --enable-profiling
 ```
 
-For Cabal, look at [profiling with Cabal sandboxes](https://nikita-volkov.github.io/profiling-cabal-projects/)
+
+Generate the profile graph with
+```
+hp2ps -M advent01.hp
+```
 
 
 # Packages
 
-Stack is using the [14.16-lts resolver](https://www.stackage.org/lts-16.25) for packages, so make sure you read the [correct documentation for the packages included in it](https://www.stackage.org/lts-16.25/docs). 
-
 Packages I used a lot:
 
 * [Containers](https://hackage.haskell.org/package/containers) (and some [better documentation](https://haskell-containers.readthedocs.io/en/latest/intro.html)); [Unordered containers](https://hackage.haskell.org/package/unordered-containers) is a mostly-equivalent alternative.