Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 3 additions & 33 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,23 +11,11 @@ Please see the [contributing guide](https://github.com/exercism/x-api/blob/maste
### Development Dependencies

You should have [Stack](http://docs.haskellstack.org/) installed in your
system to make contributing to this repository easier. Also, until we finish
migration of all exercises to stack projects
[#185](https://github.com/exercism/xhaskell/issues/185), you'll need some
additional packages installed in your *implicit global project*:

```bash
stack setup
stack install attoparsec HUnit lens old-locale parallel QuickCheck random split stm text vector
```
system to make contributing to this repository easier.

### Exercises

Currently, we have two types of exercises in this track:

###### Stack projects

We are migrating all the exercises to this new format:
All exercises have the following structure:

- `stack.yaml` has just one line specifying the current
[Stack snapshot](https://www.stackage.org/snapshots). We use the same
Expand All @@ -36,20 +24,10 @@ resolver for all the exercises.
format that has all dependencies and build instructions for an exercise.
- `src/Example.hs` is a sample solution passing the tests.
- `src/ModuleName.hs` is a *stub solution*.
- `test/Test.hs` is the test suite.

###### Legacy exercises

Legacy exercises have two or three files and no directories:

- `exercise-name_test.hs` is the tests suite.
- `example.hs` is a sample solution passing the tests.
- `ModuleName.hs` is an optional *stub solution*.
- `test/Tests.hs` is the test suite.

### Running Tests

###### Exercises that are stack projects

Rename the file `src/Example.hs` to match the module name and run:

```bash
Expand All @@ -58,14 +36,6 @@ stack test --pedantic

If the stub solution is still in the `/src` folder, build will probably fail.

###### Legacy exercises

Rename the file `example.hs` to match the module name and run:

```bash
stack runghc exercise-name_test.hs
```

## License

The MIT License (MIT)
Expand Down
6 changes: 0 additions & 6 deletions SETUP.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,6 @@ For installation and learning resources, refer to the

To run the test suite, execute the following command:

```bash
stack runghc exercise-name_test.hs
```

Or, for the latter, exercises:

```bash
stack test
```
Expand Down
10 changes: 0 additions & 10 deletions docs/INSTALLATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,6 @@ stack --version

If it outputs Stack's version, then you have it installed correctly.

## Installing dependencies

You'll also need to install some additional packages in your *implicit
global project*:

```bash
stack setup
stack install attoparsec HUnit lens old-locale parallel QuickCheck random split stm text vector
```

## Installing HLint (optional)

HLint is a tool for suggesting possible improvements to Haskell code. These
Expand Down
42 changes: 3 additions & 39 deletions docs/TESTS.md
Original file line number Diff line number Diff line change
@@ -1,31 +1,8 @@

## Running Tests

###### If the exercise's folder looks like this...

```
./README.md
./exercise-name_test.hs
```

Execute the following command to run the tests:

```bash
stack runghc exercise-name_test.hs
```

###### Otherwise, it will be like this...

```
./README.md
./stack.yaml
./package.yaml
./src/ModuleName.hs
./test/Test.hs
```

In which case you should type:

```bash
stack test
```
Expand Down Expand Up @@ -66,23 +43,10 @@ Just keep in mind that this *stub*, if available, is there just for you
to get started. Feel free to change it completely if you think it is the
right thing to do.

#### Using additional packages

If you want to use additional packages to write a more elegant solution,
you'll need to install the packages or list them in `package.yaml`, depending
on the type of exercise you are solving.

###### Exercises without a *package.yaml* file

This will install packages `foo` and `bar` to your *implicit global project*:

```bash
stack install foo bar
```

###### Exercises with a *package.yaml* file
#### Using packages

Just add the packages to your solution's dependencies in `package.yaml`:
If you want to use some packages to write a more elegant solution, just
add the packages to your solution's dependencies in `package.yaml`:

```yaml
library:
Expand Down