2 title: "Summer of Code 2018"
6 Code to solve the [Summer of Code](https://learn2.open.ac.uk/course/view.php?id=206891) puzzles. These sample solutions are in [Python](https://www.python.org/) and [Haskell](https://wiki.haskell.org/Haskell).
9 I develop the solutions with [Jupyter Lab](https://github.com/jupyterlab/).
13 [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.
15 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.
19 I'm using the basic Haskell Platform installation, togeher with `stack` to manage the packages and dependencies (install with
21 $ sudo aptitude install haskell-platform haskell-stack
25 ### Creating the repository and project
26 Create the repository as normal: create the project in Gitolite, clone it, and insert the `.gitignore` and `README.md` files.
28 There's just one package, with the code in sub-directories of the `src` directory. Each day will generate one (or more) entries in the `summerofcode2018soln.cabal` file.
30 Create the basic `stack` project. This will create a new directory. Note that this new directory name can't have a hyphen-delimited word that's just digits, so the project will have to be `advent-of-code`
33 stack new summerofcode2018soln --bare simple
36 Modify the `stack.yaml` file as needed, such as adding the `ghc-options` stanza.
38 ### Creating subsequent days
40 Each day lives in a separate directory within the `src` directory. It will also need it's own stanza in `summerofcode2018.cabal`.
56 Run interactively with
58 stack ghci summerofcode2018soln:exe:task1
63 stack build --executable-profiling --library-profiling --ghc-options="-fprof-auto -rtsopts" task1
67 stack exec -- task1 +RTS -p -hy
72 Stack is using the [12.9-lts resolver](https://www.stackage.org/lts-12.9) for packages, so make sure you read the [correct documentation for the packages included in it](https://www.stackage.org/lts-12.9/docs).
74 When you use a new package, use
79 to see how the `stack.yaml` file needs to change, and
81 stack solver --update-yaml
83 to implement the changes.
87 Build this readme file wth
89 pandoc -s README.md > README.html
92 (Using the [Modest style](https://github.com/markdowncss/modest).)