Advent of Code 2025

Please post your repo here if you’re doing it.

I tend do enjoy reading other people’s solutions, usually I always learn from it.

Here’s my day 1 solution: multi-playground/aoc/2025/haskell/Day01.hs at 36057441c62acbf42b6b382465886141ba165eb1 · benjamin-thomas/multi-playground · GitHub

I had a hunch I could use mod, but I wanted to try something different and represent a “ring” instead and try to have “inspectable” output at each step.

I learned about scanl and mapAccumL, pretty cool.

3 Likes

Mine will be here as I complete them

1 Like

I’m active on lemmy: https://programming.dev/c/advent_of_code and am posting my solutions in the daily solution threads.
There are also some other Haskell solutions, for Day 1, I think there were three or four.

Direct-Link to my Solution in the Day 1 Megathread

I’m using this to brush up on Rust this year. Probably doing everything in Haskell first, then translating. Repo is here. It’s a fairly nice setup with a Nix flake (haskell.nix + crane) and tasty-golden for tests.

Here are a couple of solutions using clash-prelude:) TristanCacqueray/advent-of-clash - Codeberg.org . It’s not very practical, but it works!

1 Like

I’m trying Haskell, C, and Sqlite here!

I’m lightly attempting to write solutions in type-level Haskell, using Symparsec for the parsing (and praying that the problems stick to integers and lists). Repo and day 1: aoc-2025/src/Raehik/Aoc2025/Solutions/Day01.hs at main · raehik/aoc-2025 · GitHub

It took about 5 minutes for the part 1 program to complete. But it did work!

4 Likes

My solutions are here: GitHub - sjoerdvisscher/aoc25: Advent of Code 2025

Here are my solutions: advent-of-code/2025 at main · jotaalvim/advent-of-code · GitHub

2 Likes

I did my first live stream live coding my solution for Day 4. I’ll be doing it again for Day 5 in just over an hour.

My solutions are here: GitHub - mpilgrem/aoc-solutions: My Haskell solutions to Advent of Code puzzles

You can find my solutions here: Only the first four days are in Haskell. I switched to Futhark afterwards because I wanted to try and learn something new.

I am stuck on Day 10 Part 2, with the puzzle input, and, consequently, can’t reach Day 12 Part 2.

I can see that the Part 2 puzzle reduces to an integer linear programming problem. So, first, I investigated linear programming libraries, in the (vain) hope that the real solutions would also be integer solutions (as in the case of the example input).

I tried simplex-method-0.2.0.0, but it did not seem to be able to cope even with the example input (perhaps I did something wrong).

Then I tried coinor-clp-0.0.0.2, which is a Haskell wrapper around a C++ library (COIN-OR/CLP). That worked (which is how I found relying on real solutions would be in vain), but not without some complexity on Windows: the MSYS2 project does not provide the C++ library for the MINGW64 environment (Stack’s default) but for others. I shifted my Stack set-up to be in the UCRT64 environment (it took me a while to realise that would require a clean slate).

At that point, I thought the C++ library COIN-OR/CBC (a mixed integer linear programming solver) could be a solution. The MSYS2 project provides it. I tried limp-cbc-0.3.2.3 (uploaded to Hackage in 2018), which is a Haskell wrapper around it, but it either (1) failed to build (with Cabal flag embedded set) or (2) failed with Access violation in generated code when executing data at 0x0 (with the Cabal flag unset). I gave up on that package.

Finally, I thought I would try returning to COIN-OR/CLP augmented with my own attempt at a ‘branch and bound’ algorithm. That worked for some items but, for others, the branching exploded (again, perhaps I did something wrong).

Those are my dead ends. I’m now going to ‘cheat’ by looking at what other Haskellers did.

I used the HiGHS solver from another language. It appears that it is available to Haskell through MIP. MIP: Library for using Mixed Integer Programming (MIP)

1 Like

Interesting! By looking into what other Haskellers looked at, I learnt that this type of integer linear programming problem can be solved, in practice, by brute force by binary expansion, pruning and recursion. I wrote up my understanding of the mathematics at https://pilgrem.com/2025/12/30/integer-linear-programming/ .