109 Commits

Author SHA1 Message Date
George Thomas
2cf462ad9d Refactor findMax to more closely match Rust 2025-12-19 16:22:26 +00:00
George Thomas
4a3506a58d Swap findMax result tuple order 2025-12-19 15:57:11 +00:00
George Thomas
415055dcc2 Allow output types to vary for different parts of same day
For now this applies to Haskell only, and it may turn out to be tricky for the Rust implementation.

In practice, the limitation hasn't turned out to be important, and we could even go the other way and use `Integer` everywhere. This does however at least help with debugging, as well as just being conceptually right.

The `nil` and `(/\)` functions are intended to be overloaded to work for other list-like things in a later commit, and from there we will investigate using `OverloadedLists` and `RebindableSyntax` to recover standard list syntax, although there are probably limitations due to `(:)` being special.
2025-12-16 16:15:11 +00:00
George Thomas
6ca7b4eac8 Match digitsToInt to simpler Rust version 2025-12-13 11:24:46 +00:00
George Thomas
dbeac46212 Format imports 2025-12-13 11:19:54 +00:00
George Thomas
cdc54a27aa Solve day 10 part 1 2025-12-11 11:34:36 +00:00
George Thomas
4b45590f37 Initialise day 10 2025-12-10 22:30:41 +00:00
George Thomas
b438db7d53 Rename square type to rectangle 2025-12-09 19:50:35 +00:00
George Thomas
2aab786dba Add trailing newlines to output for cleaner test diffs 2025-12-09 19:18:23 +00:00
George Thomas
57c1613019 Move output showing to main entry point 2025-12-09 16:57:05 +00:00
George Thomas
6e851d63f0 Show diff for golden test failures 2025-12-09 16:47:12 +00:00
George Thomas
2862457529 Solve day 9 part 2 2025-12-09 13:37:39 +00:00
George Thomas
0e2a3c81ac Correct error message 2025-12-09 13:35:54 +00:00
George Thomas
e85429629f Generalise allUnorderedPairs
Now that it's in the prelude, the desire to remove diagonals is less obvious than it was.
2025-12-09 13:35:54 +00:00
George Thomas
c608e21e26 Solve day 9 part 1 2025-12-09 13:35:54 +00:00
George Thomas
ce70643476 Initialise day 9 2025-12-09 10:27:50 +00:00
George Thomas
a258b30eae Disable implicit prelude 2025-12-09 00:28:09 +00:00
George Thomas
02fbb8c0be Minor refactor 2025-12-09 00:26:22 +00:00
George Thomas
1e3ed16971 Avoid unsafe list indexing 2025-12-09 00:02:54 +00:00
George Thomas
ea64a5af3e Consistently use separator parsing combinators in infix form 2025-12-08 23:44:43 +00:00
George Thomas
832b85fb7b Solve day 8 part 2 2025-12-08 23:38:48 +00:00
George Thomas
e92cc2f0d3 Minor refactors 2025-12-08 22:59:50 +00:00
George Thomas
1d22a1c188 Reformat 2025-12-08 22:59:50 +00:00
George Thomas
25efc19b31 Format 2025-12-08 22:59:50 +00:00
George Thomas
d0488726a0 Add argument to parser for disambiguating real data versus examples
This breaks less code than adding it to the solution functions, and is more elegant in a way.
2025-12-08 22:59:50 +00:00
George Thomas
43918c70fa Solve day 8 part 2 2025-12-08 22:59:50 +00:00
George Thomas
b0a191edb9 Solve day 8 part 1 2025-12-08 22:59:50 +00:00
George Thomas
f12e7b6e36 Solve day 7 part 2 2025-12-08 22:59:50 +00:00
George Thomas
f6f0fc171f Solve day 7 part 1 2025-12-08 22:59:50 +00:00
George Thomas
5539a4bd05 Solve day 6 part 1 2025-12-08 22:59:35 +00:00
George Thomas
cb86dad006 Initialise day 8 2025-12-08 13:41:19 +00:00
George Thomas
3412b04af1 Initialise day 7 2025-12-08 13:41:19 +00:00
George Thomas
f1db760379 Initialise day 6 2025-12-08 13:27:50 +00:00
George Thomas
371bddf748 Use custom prelude 2025-12-08 12:48:49 +00:00
George Thomas
ef731df494 Remove duplicate in dependency list 2025-12-08 11:53:14 +00:00
George Thomas
67180c098f Solve day 5 part 2 2025-12-05 16:54:25 +00:00
George Thomas
1429445efe Simplify day 5 part 1 2025-12-05 16:54:25 +00:00
George Thomas
7ba96ee3e5 Shorten test name for cleaner CLI output 2025-12-05 13:49:04 +00:00
George Thomas
62be96ed57 Solve day 5 part 1 2025-12-05 13:16:33 +00:00
George Thomas
3742e1d254 Initialise day 5 2025-12-05 12:56:40 +00:00
George Thomas
ef342a1483 Refactor day 4 and add extra tests 2025-12-05 12:09:49 +00:00
George Thomas
be0a6510d8 Use lazy text for test outputs
Simplifies encoding code slightly, and potentially saves a lot of time for failing tests. Plus we've always been using `T.show` in practice anyway, so it's an easy change to make.
2025-12-04 21:24:49 +00:00
George Thomas
f91824a6a9 Add some useful inputs to extraTests 2025-12-04 21:17:50 +00:00
George Thomas
2f35bd9251 Format 2025-12-04 21:17:50 +00:00
George Thomas
8f67916e1a Add way to specify extra tests 2025-12-04 21:17:50 +00:00
George Thomas
0508947a65 Solve day 4 part 2 2025-12-04 20:00:53 +00:00
George Thomas
9137e7cd66 Solve day 4 part 1 2025-12-04 18:02:57 +00:00
George Thomas
dea25e3359 Add some useful dependencies 2025-12-04 11:14:31 +00:00
George Thomas
0844d4af2f Initialise day 4 2025-12-04 10:00:15 +00:00
George Thomas
a81d622125 Refactor day 1 to make more use of state monad 2025-12-03 17:52:23 +00:00