09 Dec 2020
•
haskell
So what if you are like me and you want to build an executable that can pick and choose which problem’s code to run?
What if you are like me again and are tired of the workflow consisting of:
- Exporting a solver function from the problem’s module
- Importing the solver function in the main module
- Adding the solver function to a map with the correct key
More …
09 Dec 2020
•
haskell
•
aoc
Part A is a simple 2SUM. We use Vector
to speed up computation due to Part B.
More …
08 Dec 2020
•
haskell
•
aoc
AoC presents us with another computer challenge. We conjure up some data types representing the console state as well as
its instructions.
More …
07 Dec 2020
•
haskell
•
aoc
Our first goal here is to simplify the input. We conjure up the replace
function and make some replacements to our
text. We also define a data type for bags holding other bags and how to parse the cleaned up text.
More …
06 Dec 2020
•
haskell
•
aoc
This is a fantastic use case for lens
. We define a passport to be a list of fields and a field to be a key
value pair. The parser is also rather simple.
More …