Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/glguy/advent2020
Advent of Code 2020 Haskell Solutions
https://github.com/glguy/advent2020
Last synced: 4 months ago
JSON representation
Advent of Code 2020 Haskell Solutions
- Host: GitHub
- URL: https://github.com/glguy/advent2020
- Owner: glguy
- License: isc
- Created: 2020-12-01T05:28:56.000Z (about 4 years ago)
- Default Branch: master
- Last Pushed: 2020-12-29T02:51:40.000Z (about 4 years ago)
- Last Synced: 2024-05-08T20:15:27.622Z (9 months ago)
- Language: Haskell
- Size: 275 KB
- Stars: 16
- Watchers: 5
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Advent of Code 2020
These are my Advent of Code 2020 solutions. I try to focus on making clean and documented Haskell solutions to each puzzle.
We'll be chatting about AoC on IRC all December. You can find AoC discussion on [freenode](https://freenode.net)'s `##adventofcode` and `#haskell` ([webchat](https://webchat.freenode.net/#haskell,##adventofcode))
## Building
I recommend installing `ghc` with `ghcup`.
```
$ curl https://get-ghcup.haskell.org -sSf | sh
```I'm using `GHC 8.10.2` this year
```
$ ghcup install 8.10.2
$ ghcup set 8.10.2
````cabal-install-3` is the best way to get things built
```
$ cabal update
$ cabal build
```## Running solutions
All the solutions take an optional command line argument that can be an input file name or `-` to read the input from `stdin`.
```
$ cabal run Day01
...
494475
267520550
```## Common libraries used
* **containers** - Almost all of the solutions will benefit from having access to `Map` and `Set` types from this package.
* **megaparsec** - Each problem features a simple text-file format input. Parser combinators make it easy to define the simple parser needed to consume these inputs.
* **doctest** - Having checked examples in the documentation makes it easier to understand what code does and easy to add unit tests.