Skip to content

reference/concepts.md: Update concepts completed; README: Add instructions.md and config.json to practice exercise structure #1112

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Oct 1, 2022
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
14 changes: 11 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Exercism exercises in Haskell
* [Update an exercise test suite](#update-an-exercise-test-suite)
- [Repository structure and conventions](#repository-structure-and-conventions)
* [Directory structure](#directory-structure)
* [Exercise structure](#exercise-structure)
* [Practice exercise structure](#practice-exercise-structure)
* [Exercise versioning](#exercise-versioning)
- [Development Dependencies](#development-dependencies)
- [Stub solution](#stub-solution)
Expand Down Expand Up @@ -128,32 +128,40 @@ The [track anatomy documentation](https://github.com/exercism/docs/blob/master/l
│ │ └── Accumulate.hs
│ ├── test
│ │ └── Tests.hs
│ ├── .docs
│ │ └── instructions.md
│ └── .meta
│ ├── examples
│ │ └── success-standard
│ │ ├── package.yaml
│ │ └── src
│ │ └── Accumulate.hs
│ ├── config.json
│ └── hints.md
├── allergies
│ └── ...
└── ...
```
- `config.json`: Every exercise has to be registered here. It has a unique name and a difficulty. The sequence order is also the default order in which the exercises are fetched.

## Exercise structure
Each exercise has the following structure:
## Practice exercise structure
Each practice exercise has the following structure:
- `stack.yaml` has just one line specifying the current
[Stack snapshot](https://www.stackage.org/snapshots). We use the same
resolver for all the exercises.
- `package.yaml` is a file in the [hpack](https://github.com/sol/hpack#readme)
format that has all dependencies and build instructions for an exercise.
One of the properties tracked in `package.yaml` is the [version](#exercise-versioning) of the exercise.
- `src/ModuleName.hs` is a [stub solution](#stub-solution).
- `.docs/instructions.md` contains the instructions and requirements to complete the exercise.
For an exercise from [problem-specifications](https://github.com/exercism/problem-specifications/), this file should exactly match the description.md from problem-specifications.
The [Exercism-wide documentation for instructions.md](https://github.com/exercism/docs/blob/main/building/tracks/practice-exercises.md#file-docsinstructionsmd) contains more information.
- `.meta/examples/success-<name>/package.yaml` contains library dependencies for the [example solution](#example-solution). `<name>` is a unique name for the example - usually "standard" (as in `success-standard`), but it can be some other name in case of multiple example solutions.
- `.meta/examples/success-<name>/src/ModuleName.hs` is the source code of the sample solution.
- `test/Tests.hs` is the [test suite](#test-suite).
- `.meta/hints.md` is an optional file containing instructions and/or hints. It is used together with the respective `description.md` for the exercise from [problem-specifications](https://github.com/exercism/problem-specifications) to build the `README.md` file.
- `.meta/config.json` is the exercise configuration file.
The [Exercism-wide documentation for .meta/config.json](https://github.com/exercism/docs/blob/main/building/tracks/practice-exercises.md#file-metaconfigjson) contains more information.

## Exercise versioning

Expand Down
18 changes: 9 additions & 9 deletions reference/concepts.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ The Haskell concept exercises are based on concepts. The list below contains the
- [ ] Tail recursion
- [ ] Type declarations & annotations
- [ ] Immutability
- [ ] Pattern matching
- [ ] Wildcards
- [ ] Guard clauses
- [x] Pattern matching
- [x] Wildcards
- [x] Guard clauses
- [ ] Type inference
- [ ] Polymorphism by default

Expand Down Expand Up @@ -67,18 +67,18 @@ The Haskell concept exercises are based on concepts. The list below contains the
- [ ] Resource allocation
- [ ] Scoping
- [ ] Imports
- [ ] Modules
- [x] Modules
- [ ] Namespaces
- [ ] Shadowing
- [ ] Visibility (export or not)
- [ ] Whitespace significant
- [x] Visibility (export or not)
- [x] Whitespace significant
- [ ] String formatting
- [ ] Values
- [ ] Definitions
- [x] Values
- [x] Definitions

### Types

- [ ] Booleans
- [x] Booleans
- [ ] Characters
- [ ] Collections
- [ ] Arrays
Expand Down