From 67ab70182bd28ebd5cba9903d2d089e9fd9539f8 Mon Sep 17 00:00:00 2001 From: Jacob Jonsson Date: Wed, 7 Jan 2026 23:32:35 +0100 Subject: [PATCH] chore: setup project for multi-cradle hls We might not need all files added to components, but we might as well since it gives us the possibility to open any file in our editors and LSP will automatically figure out what component it belongs to. --- aoc25.cabal | 65 ++++++++++++++++++++++++++++++++++++++++------------- app/Main.hs | 4 ---- hie.yaml | 20 +++++++++++++++++ 3 files changed, 69 insertions(+), 20 deletions(-) delete mode 100644 app/Main.hs create mode 100644 hie.yaml diff --git a/aoc25.cabal b/aoc25.cabal index 9114f1e..d93591f 100644 --- a/aoc25.cabal +++ b/aoc25.cabal @@ -53,27 +53,52 @@ extra-doc-files: CHANGELOG.md common warnings ghc-options: -Wall -executable aoc25 - -- Import common warning flags. +executable day1 import: warnings - - -- .hs or .lhs file containing the Main module. - main-is: Main.hs - - -- Modules included in this executable, other than Main. - -- other-modules: - - -- LANGUAGE extensions used by modules in this package. - -- other-extensions: - - -- Other library packages from which modules are imported. + main-is: Day1.hs build-depends: base ^>=4.20.2, containers >= 0.6.7 - - -- Directories containing source files. hs-source-dirs: app + default-language: GHC2021 - -- Base language which the package is written in. +executable day2 + import: warnings + main-is: Day2.hs + build-depends: base ^>=4.20.2, + containers >= 0.6.7 + hs-source-dirs: app + default-language: GHC2021 + +executable day3 + import: warnings + main-is: Day3.hs + build-depends: base ^>=4.20.2, + containers >= 0.6.7 + hs-source-dirs: app + default-language: GHC2021 + +executable day4 + import: warnings + main-is: Day4.hs + build-depends: base ^>=4.20.2, + containers >= 0.6.7 + hs-source-dirs: app + default-language: GHC2021 + +executable day5 + import: warnings + main-is: Day5.hs + build-depends: base ^>=4.20.2, + containers >= 0.6.7 + hs-source-dirs: app + default-language: GHC2021 + +executable day6 + import: warnings + main-is: Day6.hs + build-depends: base ^>=4.20.2, + containers >= 0.6.7 + hs-source-dirs: app default-language: GHC2021 executable day7 @@ -91,3 +116,11 @@ executable day8 containers >= 0.6.7 hs-source-dirs: app default-language: GHC2021 + +executable day9 + import: warnings + main-is: Day9.hs + build-depends: base ^>=4.20.2, + containers >= 0.6.7 + hs-source-dirs: app + default-language: GHC2021 diff --git a/app/Main.hs b/app/Main.hs deleted file mode 100644 index 65ae4a0..0000000 --- a/app/Main.hs +++ /dev/null @@ -1,4 +0,0 @@ -module Main where - -main :: IO () -main = putStrLn "Hello, Haskell!" diff --git a/hie.yaml b/hie.yaml new file mode 100644 index 0000000..b334116 --- /dev/null +++ b/hie.yaml @@ -0,0 +1,20 @@ +cradle: + stack: + - path: "./app/Day1.hs" + component: "aoc25:exe:day1" + - path: "./app/Day2.hs" + component: "aoc25:exe:day2" + - path: "./app/Day3.hs" + component: "aoc25:exe:day3" + - path: "./app/Day4.hs" + component: "aoc25:exe:day4" + - path: "./app/Day5.hs" + component: "aoc25:exe:day5" + - path: "./app/Day6.hs" + component: "aoc25:exe:day6" + - path: "./app/Day7.hs" + component: "aoc25:exe:day7" + - path: "./app/Day8.hs" + component: "aoc25:exe:day8" + - path: "./app/Day9.hs" + component: "aoc25:exe:day9"