chore(haskell): update base and add stack file

This commit is contained in:
pulsation 2018-10-22 21:42:11 +02:00
parent 8a910c446d
commit 14215d090a
6 changed files with 16 additions and 32 deletions

View File

@ -1,14 +1,19 @@
# Haskell port of the Gilded-Rose Kata # Haskell port of the Gilded-Rose Kata
This is a Haskell port of the *Gilded-Rose-Kata*. For updates and pull-request This is a Haskell port of the *Gilded-Rose-Kata*.
on this haskell port go to https://github.com/sheyll/gilded-rose-haskell
## Prerequisite
If you don't have a recent Stack version installed in your system, follow the
[installation instructions](https://docs.haskellstack.org/en/stable/install_and_upgrade/)
for your operating system.
## Building and Running ## Building and Running
Run `./install_deps.sh` initially, then `./test.sh` to execute the tests after Run `stack build` initially, then `stack test` to execute the tests after
each refactoring. each refactoring.
To execute the program run `./run.sh [days]` where `[days]` denotes an optional To execute the program run `stack run [days]` where `[days]` denotes an optional
parameter for the number of days to simulate. parameter for the number of days to simulate.
Tests are in `test/GildedRoseSpec.hs`. Refer to http://hspec.github.io/ for Tests are in `test/GildedRoseSpec.hs`. Refer to http://hspec.github.io/ for

View File

@ -10,15 +10,16 @@ cabal-version: >=1.10
library library
exposed-modules: GildedRose exposed-modules: GildedRose
build-depends: base >=4.7 && <4.8 build-depends: base >=4.7
hs-source-dirs: src hs-source-dirs: src
default-language: Haskell2010 default-language: Haskell2010
executable gilded-rose executable gilded-rose
main-is: Main.hs main-is: Main.hs
build-depends: gilded-rose, base >=4.7 && <4.8 build-depends: gilded-rose, base >=4.7
hs-source-dirs: src hs-source-dirs: src
default-language: Haskell2010 default-language: Haskell2010
other-modules: GildedRose
test-suite spec test-suite spec
type: exitcode-stdio-1.0 type: exitcode-stdio-1.0
@ -27,7 +28,7 @@ test-suite spec
default-language: Haskell2010 default-language: Haskell2010
main-is: Spec.hs main-is: Spec.hs
other-modules: GildedRoseSpec other-modules: GildedRoseSpec
build-depends: base >=4.7 && <4.8 build-depends: base >=4.7
, gilded-rose , gilded-rose
, hspec , hspec
, hspec-expectations , hspec-expectations

View File

@ -1,8 +0,0 @@
#!/bin/bash
#
# Fetch and build all dependencies
#
set -eu
cabal install --enable-tests --disable-optimization --dependencies-only
cabal -v0 configure --enable-tests --disable-optimization

View File

@ -1,8 +0,0 @@
#!/bin/bash
#
# Rebuild the project and run Main.main with all arguments passed to this
# script.
#
set -eu
cabal -v0 run $@

3
haskell/stack.yaml Normal file
View File

@ -0,0 +1,3 @@
resolver: lts-12.14
packages:
- .

View File

@ -1,9 +0,0 @@
#!/bin/bash
#
# Rebuild the project and run the hspec based unit tests. This could have been
# achieved by 'cabal test' but then the output would not be as colorful.
#
set -eu
cabal -v0 build
./dist/build/spec/spec $@