title | subtitle | author | toc-title | landing-page |
---|---|---|---|---|
Advent of Code 2021 |
solutions, literally in Haskell |
Johan Hidding |
Contents |
advent-of-code-2021 |
This year I will publish my solutions for Advent of Code in Haskell, using Entangled to do Literate Programming.
Advent of Code is an anual coding challenge keeping nerds off the street for the entire merry month of decemeber. This is officially the best way to learn a new programming language or improve on your existing skills.
{.warning}
If you're still trying to solve AOC2021, this site contains spoilers.
Entangled is a tool for Literate Programming. My challenge for this years' Advent of Code is to create a set of beautifull solutions, that are completely documented in a literate form. The idea is that the code you see here is the complete solution to a problem. Think of Entangled as a content-management system for code blocks in your Markdown documents. The code blocks are assembled into compilable code, while changes are also tracked back to your markdown files. This means you can still debug and work with your favourite IDE.
To run this code, I recommend installing Haskell using the GHCUp installer. Run all solutions:
cabal run x2021 -- -a
All solutions use the RIO
library to replace the standard Prelude
. This saves a long list of standard imports and is much better suited to modern Haskell practices. Most of the input parsing is done through Megaparsec
, for which I have a submodule that contains some common types and functions, see the boilerplate section.
This code is licensed under the Apache v2 license, see LICENSE
file in this repository.