Skip to content

Commit

Permalink
[Housekeeping] Should have committed this before but didn't get aroun…
Browse files Browse the repository at this point in the history
…d doing it

* Includes .cabal file per
commercialhaskell/stack#5210
* Updates package.yaml with the new dependencies.
* Updates the stackage resolver in stack.yaml to force a version that is
usable with my setup. Also updates stack.yaml.lock.
* Updates the instructions in setup.hs and stack.yaml with the latest findings.
  • Loading branch information
namasme committed Dec 11, 2022
1 parent ca82727 commit 5c94dde
Show file tree
Hide file tree
Showing 5 changed files with 150 additions and 13 deletions.
118 changes: 118 additions & 0 deletions aoc2022.cabal
Original file line number Diff line number Diff line change
@@ -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 <https://github.com/githubuser/aoc2022#readme>
homepage: https://github.com/cronos2/aoc2022#readme
bug-reports: https://github.com/cronos2/aoc2022/issues
author: Nacho Mas
maintainer: [email protected]
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
6 changes: 6 additions & 0 deletions package.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ library:
source-dirs: src
dependencies:
- containers
- microlens-platform
- parsec
- split

executables:
Expand All @@ -38,6 +40,8 @@ executables:
dependencies:
- aoc2022
- containers
- microlens-platform
- parsec
- split

tests:
Expand All @@ -51,5 +55,7 @@ tests:
dependencies:
- aoc2022
- containers
- microlens-platform
- hspec
- parsec
- split
21 changes: 19 additions & 2 deletions setup.sh
Original file line number Diff line number Diff line change
@@ -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
9 changes: 3 additions & 6 deletions stack.yaml
Original file line number Diff line number Diff line change
@@ -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
9 changes: 4 additions & 5 deletions stack.yaml.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 5c94dde

Please sign in to comment.