From 6a79211becb63ae98d6256513d05c6512462870d Mon Sep 17 00:00:00 2001 From: Sloane Perrault Date: Thu, 1 Dec 2022 08:39:35 -0500 Subject: [PATCH] move stack templates for package.yaml support --- 2022/.gitignore | 5 ++- 2022/LICENSE | 2 +- 2022/aoc.cabal | 89 ++++++++++++++++++++++++++------------- 2022/{src => app}/Main.hs | 0 2022/package.yaml | 59 ++++++++++++++++++++++++++ 2022/src/Lib.hs | 6 +++ 2022/test/Spec.hs | 2 + 7 files changed, 131 insertions(+), 32 deletions(-) rename 2022/{src => app}/Main.hs (100%) create mode 100644 2022/package.yaml create mode 100644 2022/src/Lib.hs create mode 100644 2022/test/Spec.hs diff --git a/2022/.gitignore b/2022/.gitignore index 30e42fc..d5dab60 100644 --- a/2022/.gitignore +++ b/2022/.gitignore @@ -1,2 +1,3 @@ -/input -/.stack-work +input/ +.stack-work/ +*~ diff --git a/2022/LICENSE b/2022/LICENSE index b387188..406ecc0 100644 --- a/2022/LICENSE +++ b/2022/LICENSE @@ -27,4 +27,4 @@ LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. \ No newline at end of file +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/2022/aoc.cabal b/2022/aoc.cabal index 8cce137..e130fc6 100644 --- a/2022/aoc.cabal +++ b/2022/aoc.cabal @@ -1,30 +1,61 @@ -name: aoc -version: 0.1.0.0 --- synopsis: --- description: -homepage: https://github.com/sloanelybutsurely/aoc#readme -license: BSD3 -license-file: LICENSE -author: Sloane Perrault -maintainer: sloane.perrault@gmail.com -copyright: none -category: puzzles -build-type: Simple -cabal-version: >=1.10 -extra-source-files: README.md - CHANGELOG.md +cabal-version: 1.12 -executable aoc - hs-source-dirs: src - main-is: Main.hs - default-language: Haskell2010 - build-depends: base >= 4.7 && < 5 - ghc-options: -Wall - -Wcompat - -Widentities - -Wincomplete-record-updates - -Wincomplete-uni-patterns - -Wmissing-export-lists - -Wmissing-home-modules - -Wpartial-fields - -Wredundant-constraints +-- This file has been generated from package.yaml by hpack version 0.35.0. +-- +-- see: https://github.com/sol/hpack + +name: aoc +version: 0.1.0.0 +description: Please see the README on GitHub at +homepage: https://github.com/sloanelybutsurely/aoc#readme +bug-reports: https://github.com/sloanelybutsurely/aoc/issues +author: Sloane Perrault +maintainer: sloane.perrault@gmail.com +copyright: none +license: BSD3 +license-file: LICENSE +build-type: Simple +extra-source-files: + README.md + CHANGELOG.md + +source-repository head + type: git + location: https://github.com/sloanelybutsurely/aoc + +library + exposed-modules: + Lib + other-modules: + Paths_aoc + hs-source-dirs: + src + ghc-options: -Wall -Wcompat -Widentities -Wincomplete-record-updates -Wincomplete-uni-patterns -Wmissing-export-lists -Wmissing-home-modules -Wpartial-fields -Wredundant-constraints + build-depends: + base >=4.7 && <5 + default-language: Haskell2010 + +executable aoc-exe + main-is: Main.hs + other-modules: + Paths_aoc + hs-source-dirs: + app + ghc-options: -Wall -Wcompat -Widentities -Wincomplete-record-updates -Wincomplete-uni-patterns -Wmissing-export-lists -Wmissing-home-modules -Wpartial-fields -Wredundant-constraints -threaded -rtsopts -with-rtsopts=-N + build-depends: + aoc + , base >=4.7 && <5 + default-language: Haskell2010 + +test-suite aoc-test + type: exitcode-stdio-1.0 + main-is: Spec.hs + other-modules: + Paths_aoc + hs-source-dirs: + test + ghc-options: -Wall -Wcompat -Widentities -Wincomplete-record-updates -Wincomplete-uni-patterns -Wmissing-export-lists -Wmissing-home-modules -Wpartial-fields -Wredundant-constraints -threaded -rtsopts -with-rtsopts=-N + build-depends: + aoc + , base >=4.7 && <5 + default-language: Haskell2010 diff --git a/2022/src/Main.hs b/2022/app/Main.hs similarity index 100% rename from 2022/src/Main.hs rename to 2022/app/Main.hs diff --git a/2022/package.yaml b/2022/package.yaml new file mode 100644 index 0000000..a26f7e5 --- /dev/null +++ b/2022/package.yaml @@ -0,0 +1,59 @@ +name: aoc +version: 0.1.0.0 +github: "sloanelybutsurely/aoc" +license: BSD3 +author: "Sloane Perrault" +maintainer: "sloane.perrault@gmail.com" +copyright: "none" + +extra-source-files: +- README.md +- CHANGELOG.md + +# Metadata used when publishing your package +# synopsis: Short description of your package +# category: puzzles + +# To avoid duplicated efforts in documentation and dealing with the +# complications of embedding Haddock markup inside cabal files, it is +# common to point users to the README.md file. +description: Please see the README on GitHub at + +dependencies: +- base >= 4.7 && < 5 + +ghc-options: +- -Wall +- -Wcompat +- -Widentities +- -Wincomplete-record-updates +- -Wincomplete-uni-patterns +- -Wmissing-export-lists +- -Wmissing-home-modules +- -Wpartial-fields +- -Wredundant-constraints + +library: + source-dirs: src + +executables: + aoc-exe: + main: Main.hs + source-dirs: app + ghc-options: + - -threaded + - -rtsopts + - -with-rtsopts=-N + dependencies: + - aoc + +tests: + aoc-test: + main: Spec.hs + source-dirs: test + ghc-options: + - -threaded + - -rtsopts + - -with-rtsopts=-N + dependencies: + - aoc diff --git a/2022/src/Lib.hs b/2022/src/Lib.hs new file mode 100644 index 0000000..d36ff27 --- /dev/null +++ b/2022/src/Lib.hs @@ -0,0 +1,6 @@ +module Lib + ( someFunc + ) where + +someFunc :: IO () +someFunc = putStrLn "someFunc" diff --git a/2022/test/Spec.hs b/2022/test/Spec.hs new file mode 100644 index 0000000..cd4753f --- /dev/null +++ b/2022/test/Spec.hs @@ -0,0 +1,2 @@ +main :: IO () +main = putStrLn "Test suite not yet implemented"