Skip to content

Commit

Permalink
using stack
Browse files Browse the repository at this point in the history
  • Loading branch information
opqdonut committed Jun 5, 2017
1 parent 22e327f commit ad951ac
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 6 deletions.
3 changes: 2 additions & 1 deletion .gitignore
@@ -1 +1,2 @@
*~
*~
.stack-work
39 changes: 34 additions & 5 deletions README.md
@@ -1,8 +1,35 @@
Opqdonut's Haskell Exercises
============================

Quick Start
-----------
Quick Start using Stack
-----------------------

1. Install [Stack](https://www.haskellstack.org/)

2. Download dependencies by running

$ stack build

2. Then check you can actually run the tests with:

$ stack runhaskell W0Test.hs

This should print `Everything seems to be OK!`. If you see any errors,
you might not have a problem with your Haskell installation.

3. Generate the exercise templates (files `W*.hs`):

$ make

4. Now you can edit `W1.hs` and see how well you did by running

$ stack runhaskell W1Test.hs

Alternative Quick Start using cabal
-----------------------------------

In case you have problems with `stack`, here is a more old-fashioned
way to work with the exercises.

1. Install [The Haskell Platform](https://www.haskell.org/platform/)

Expand Down Expand Up @@ -67,7 +94,8 @@ Working on the Excercises
- Edit the Wn.hs files according to the instructions
- Don't remove or change any type signatures (things like `foo ::
String -> String`) that are already in the files
- Check your answers for week `n` with `runhaskell WnTest.hs`
- Check your answers for week `n` with `stack runhaskell WnTest.hs`
(or just `runhaskell WnTest.hs` if you're not using stack)
- A typical test failure looks like this:

Testing 11
Expand All @@ -84,8 +112,9 @@ Working on the Excercises
I'm sorry if the test failures aren't always understandable :/

- You can also play around with your solutions interactively by
running `ghci Wn.hs`. This is a good idea for instance when you
don't understand the test failures.
running `stack exec ghci Wn.hs` (or `ghci Wn.hs`).
This is a good idea for instance when you don't understand the
test failures.

Solutions
---------
Expand Down
8 changes: 8 additions & 0 deletions haskell-exercises.cabal
@@ -0,0 +1,8 @@
name: haskell-exercises
version: 0.0.1
build-type: Simple
cabal-version: >= 1.10

library
build-depends: QuickCheck
default-language: Haskell2010
2 changes: 2 additions & 0 deletions stack.yaml
@@ -0,0 +1,2 @@
resolver: lts-8.17
install-ghc: true

0 comments on commit ad951ac

Please sign in to comment.