Skip to content

Commit deab1f8

Browse files
committed
Stub out day 14 in Haskell
1 parent 9f096fa commit deab1f8

File tree

8 files changed

+85
-1
lines changed

8 files changed

+85
-1
lines changed

Diff for: .github/workflows/run.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
strategy:
1212
matrix:
1313
os: ['ubuntu-latest', 'macos-latest']
14-
day: ['01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12', '13']
14+
day: ['01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12', '13', '14']
1515
exclude:
1616
# TODO: Investigate why building Zig on macOS fails
1717
# https://github.com/fwcd/advent-of-code-2024/actions/runs/12202208638/job/34042374507

Diff for: README.md

+1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ My solutions to the [Advent of Code 2024](https://adventofcode.com/2024), writte
1919
- [x] [**Day 11**](day11): [Lua](day11/src/day11.lua)
2020
- [x] [**Day 12**](day12): [Objective-C](day12/src/day12.m)
2121
- [x] [**Day 13**](day13): [Python](day13/src/day13.py)
22+
- [ ] [**Day 14**](day14): [Haskell](day14/src/Day14.hs)
2223

2324
## Development
2425

Diff for: day14/derivation.nix

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{ stdenv, ghc }:
2+
stdenv.mkDerivation {
3+
name = "advent-of-code-2024-day14";
4+
src = ./src;
5+
6+
nativeBuildInputs = [
7+
ghc
8+
];
9+
10+
buildPhase = ''
11+
mkdir out
12+
ghc -o out/day14 Day14.hs
13+
'';
14+
15+
installPhase = ''
16+
mkdir -p $out/bin
17+
cp out/day14 $out/bin
18+
'';
19+
}

Diff for: day14/flake.lock

+27
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: day14/flake.nix

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{
2+
description = "Advent of Code 2024 - Day 14 solution";
3+
4+
inputs = {
5+
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
6+
};
7+
8+
outputs = { self, nixpkgs }:
9+
let
10+
supportedSystems = [ "x86_64-linux" "x86_64-darwin" "aarch64-linux" "aarch64-darwin" ];
11+
forAllSystems = nixpkgs.lib.genAttrs supportedSystems;
12+
in {
13+
packages = forAllSystems (system:
14+
let
15+
pkgs = import nixpkgs { inherit system; };
16+
in {
17+
default = pkgs.callPackage ./derivation.nix {};
18+
}
19+
);
20+
21+
apps = forAllSystems (system: {
22+
default = {
23+
type = "app";
24+
program = "${self.packages.${system}.default}/bin/day14";
25+
};
26+
});
27+
};
28+
}

Diff for: day14/resources/demo.txt

Whitespace-only changes.

Diff for: day14/src/Day14.hs

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
main :: IO ()
2+
main = putStrLn "Hello world"

Diff for: paths.json

+7
Original file line numberDiff line numberDiff line change
@@ -102,5 +102,12 @@
102102
},
103103
"path": "day13/src/day13.py",
104104
"completed": true
105+
},
106+
{
107+
"lang": {
108+
"codemirror": "haskell",
109+
"name": "Haskell"
110+
},
111+
"path": "day14/src/Day14.hs"
105112
}
106113
]

0 commit comments

Comments
 (0)