43 Commits

Author SHA1 Message Date
George Thomas
fc623d0ea6 Add proper test display function 2026-01-06 23:15:37 +00:00
George Thomas
99de1c4d40 Add pretty-simple to prelude 2026-01-06 23:15:03 +00:00
George Thomas
9246597b49 Render ASCII drawing of test tree 2026-01-06 23:14:56 +00:00
George Thomas
ce8cfeca67 Format 2026-01-06 23:14:50 +00:00
George Thomas
ecb7391468 Tidy up main 2026-01-06 23:14:43 +00:00
George Thomas
db41a65453 Avoid forcing puzzle parts outputs
Note that:
- This allows us to remove some very temporary hacky code from day 4.
- This includes a refactoring to hide `TestTree`, which could in theory have been made separate.
- This reverts a lot of 1163889.
2026-01-06 23:14:36 +00:00
George Thomas
f213cdb6c3 Minor refactor 2026-01-06 23:14:25 +00:00
George Thomas
cd292d4580 Define withConstrained 2026-01-06 23:14:17 +00:00
George Thomas
83e4489e1f Add timing information to tests
Most of this is concerned with propagating `NFData` constraints.
2026-01-06 23:13:58 +00:00
George Thomas
c1813b4725 Use safe indices for test part lookup 2026-01-05 18:31:34 +00:00
George Thomas
fbc63c221b Minor refactor 2026-01-05 17:00:21 +00:00
George Thomas
a47e738ec2 Avoid printing empty extra test trees 2026-01-05 17:00:21 +00:00
George Thomas
24a21e3807 Remove heterogenous list length function 2026-01-05 17:00:21 +00:00
George Thomas
7ee7b458ce Format 2026-01-05 17:00:21 +00:00
George Thomas
0dfb8ae7bf Minor refactor 2026-01-05 17:00:21 +00:00
George Thomas
c3e69cde09 Move to custom test library 2026-01-05 17:00:15 +00:00
George Thomas
234640fb1a Add non-parameterised version of HList fold 2026-01-04 02:58:50 +00:00
George Thomas
c4b85eac71 Inline some functions and simplify 2026-01-04 02:58:45 +00:00
George Thomas
784e6f2fb2 Generalise puzzle parts type 2026-01-04 02:14:35 +00:00
George Thomas
f7c9297a85 Reuse expensive computation for day 4 extra tests
Ideally we'd similarly add the ability for later tests to use the results of earlier ones. But this would probably require much heavier type family usage.
2025-12-31 01:49:16 +00:00
George Thomas
450d7e5240 Port from Tasty to Sydtest
There are some drawbacks:
- No properly lazy golden tests. This would in principle be nice when e.g. using `pretty-simple`.
- Because tests can be created dynamically, they can't be listed up front without running them. This presumably makes filtering slightly more annoying to use in practice.
- Terminal output is less compact than tasty, both horizontally and vertically. There appears to be no way to change this.
- We end up defining an orphan `Monoid (TestDefM '[] () ())` instance, to avoid changing much downstream code. Note though that this is not strictly necessary, and could potentially be contributed upstream.
- There's a warning about threads in GHCI which we can't seem to disable.
- The license forbids use in commercial projects without sponsoring. Thankfully that doesn't apply here.

Anyway, it's generally very impressive. It simplifies a few things for us, and will particularly help when we come to want to specify dependencies between tests.
2025-12-31 01:49:07 +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
dbeac46212 Format imports 2025-12-13 11:19:54 +00:00
George Thomas
4b45590f37 Initialise day 10 2025-12-10 22:30:41 +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
ce70643476 Initialise day 9 2025-12-09 10:27: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
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
3742e1d254 Initialise day 5 2025-12-05 12:56:40 +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
0844d4af2f Initialise day 4 2025-12-04 10:00:15 +00:00
George Thomas
b99bacc1e3 Initialise day 3 2025-12-03 11:18:04 +00:00
George Thomas
83b994965d Use consistent naming convention for puzzles 2025-12-02 15:22:21 +00:00
George Thomas
f0c2b8ca02 Move code out to separate modules 2025-12-02 15:19:11 +00:00
George Thomas
3b093aac23 Use named directory for Haskell source
Makes way for other languages.
2025-12-02 14:59:15 +00:00