diff --git a/aoc2022.cabal b/aoc2022.cabal new file mode 100644 index 0000000..23a5ba3 --- /dev/null +++ b/aoc2022.cabal @@ -0,0 +1,118 @@ +cabal-version: 1.12 + +-- This file has been generated from package.yaml by hpack version 0.35.0. +-- +-- see: https://github.com/sol/hpack + +name: aoc2022 +version: 0.1.0.0 +description: Please see the README on GitHub at +homepage: https://github.com/cronos2/aoc2022#readme +bug-reports: https://github.com/cronos2/aoc2022/issues +author: Nacho Mas +maintainer: ignaciomasmesa@gmail.com +copyright: 2022 Nacho Mas +license: BSD3 +license-file: LICENSE +build-type: Simple +extra-source-files: + README.md + +source-repository head + type: git + location: https://github.com/cronos2/aoc2022 + +library + exposed-modules: + Day1.First + Day1.Second + Day10.First + Day10.Second + Day2.First + Day2.Second + Day3.First + Day3.Second + Day4.First + Day4.Second + Day5.First + Day5.First.Internal + Day5.Second + Day6.First + Day6.Second + Day7.First + Day7.First.Internal + Day7.Second + Day8.First + Day8.Second + Day9.First + Day9.Second + Lib + Utils.Common + Utils.Spatial + other-modules: + Paths_aoc2022 + hs-source-dirs: + src + build-depends: + base >=4.7 && <5 + , containers + , microlens-platform + , parsec + , split + default-language: Haskell2010 + +executable aoc2022-exe + main-is: Main.hs + other-modules: + Paths_aoc2022 + hs-source-dirs: + app + ghc-options: -threaded -rtsopts -with-rtsopts=-N + build-depends: + aoc2022 + , base >=4.7 && <5 + , containers + , microlens-platform + , parsec + , split + default-language: Haskell2010 + +test-suite aoc2022-test + type: exitcode-stdio-1.0 + main-is: Spec.hs + other-modules: + Day1.FirstSpec + Day1.SecondSpec + Day10.FirstSpec + Day10.SecondSpec + Day2.FirstSpec + Day2.SecondSpec + Day3.FirstSpec + Day3.SecondSpec + Day4.FirstSpec + Day4.SecondSpec + Day5.FirstSpec + Day5.SecondSpec + Day6.FirstSpec + Day6.SecondSpec + Day7.FirstSpec + Day7.SecondSpec + Day8.FirstSpec + Day8.SecondSpec + Day9.FirstSpec + Day9.SecondSpec + Utils.CommonSpec + Utils.SpatialSpec + Paths_aoc2022 + hs-source-dirs: + test + ghc-options: -threaded -rtsopts -with-rtsopts=-N + build-depends: + aoc2022 + , base >=4.7 && <5 + , containers + , hspec + , microlens-platform + , parsec + , split + default-language: Haskell2010 diff --git a/package.yaml b/package.yaml index 27c4b13..43587b3 100644 --- a/package.yaml +++ b/package.yaml @@ -25,6 +25,8 @@ library: source-dirs: src dependencies: - containers + - microlens-platform + - parsec - split executables: @@ -38,6 +40,8 @@ executables: dependencies: - aoc2022 - containers + - microlens-platform + - parsec - split tests: @@ -51,5 +55,7 @@ tests: dependencies: - aoc2022 - containers + - microlens-platform - hspec + - parsec - split diff --git a/setup.sh b/setup.sh index 2df9ccb..e5f2d82 100644 --- a/setup.sh +++ b/setup.sh @@ -1,7 +1,24 @@ #!/bin/zsh -# This is just documentation for me to remember how I set this up in the future +# This is just documentation for me to remember how I set this up in the future. +# Not to be confused with Setup.hs stack new aoc2022 new-template +# Stack will ignore the system installation of GHC and other tools even when +# explicitly requested (with `system-ghc true`) and will instead install its own +# (despite `install-ghc false`) in ~/.stack/programs/x86_64-osx (location is +# obviously platform-dependent). +# +# This might only be a problem if the version it decides to install does not +# have HLS support, as Doom Emacs is integrated (?) with Stack (see +# https://docs.doomemacs.org/latest/modules/lang/haskell/) and will attempt to +# use the language server for the project's version of GHC. If this happens and +# you get an error, use GHCup to check which GHC versions do offer HLS support +# in MacOS, then see stack.yaml. +# +# stack config set install-ghc false --global +# stack config set system-ghc true --global git init mkdir data -# copy makeday.sh +# TODO: integrate make-day and test-day with Stack/Cabal (akin to NPM scripts). +# copy make-day.sh +# copy test-day.sh # copy day-template dir diff --git a/stack.yaml b/stack.yaml index 7e68a05..1e8e466 100644 --- a/stack.yaml +++ b/stack.yaml @@ -1,8 +1,5 @@ packages: - . -resolver: - # I had to change the compiler to point to the specific version I had installed, but then it conflicted - # with the versions in the latest snapshot. Adding the url parameter to point to a specific version - # of the snapshot was incompatible with specifying the compiler, so I deleted that and it worked. - # I should look a bit more into this when time allows. - url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/lts/18/18.yaml +# The version of GHC Stack uses for the project can be indirectly modified via +# this parameter. See https://www.stackage.org/ for details. +resolver: lts-19.33 diff --git a/stack.yaml.lock b/stack.yaml.lock index cc26a00..d79c369 100644 --- a/stack.yaml.lock +++ b/stack.yaml.lock @@ -6,8 +6,7 @@ packages: [] snapshots: - completed: - size: 586296 - url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/lts/18/18.yaml - sha256: 63539429076b7ebbab6daa7656cfb079393bf644971156dc349d7c0453694ac2 - original: - url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/lts/18/18.yaml + sha256: 6d1532d40621957a25bad5195bfca7938e8a06d923c91bc52aa0f3c41181f2d4 + size: 619204 + url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/lts/19/33.yaml + original: lts-19.33