[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
## 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
```
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
```
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.