Skip to content

CharlonTank/elm

 
 

Repository files navigation

Exercism Elm Track

build status

Exercism Exercises in Elm

Track Organization

The track is organized with the following main directories and files:

bin/          # executables required to manage the track
config/       # configuration files for the track
docs/         # documentation files for automatically generated web pages on exercism.io
exercises/    # contains one directory per exercise
template/     # template used when generating a new exercise
.travis.yml   # Travis automatic build and tests configuration
config.json   # configuration file for all exercises metadata
package.json  # Node package configuration required for running builds and tests

Each exercise within the exercises/ directory has the following structure:

src/                   # directory for elm source files
  Exercise.elm         # template downloaded by students
  Exercise.example.elm # example solution for this exercise
tests/
  Tests.elm            # test file as downloaded by students
README.md              # generated readme (do not edit by hand)
elm.json               # elm json config file

Contributing

We welcome contributions of all sorts and sizes, from reporting issues to submitting patches or implementing missing exercises. Please read first Exercism contribution guidelines. If you are not familiar with git and GitHub, you can also have a look at GitHub's getting started documentation.

Setup

In order to contribute code to this track, you need to have already installed npm, elm, elm-test, and elm-format. The build and tests script for this track lives at bin/build.sh. It uses the locally installed versions of elm, elm-test and elm-format, specified in the package.json file. Thus you can run bin/build.sh without the need of having those installed globally but it will be quite inconvenient when working on single exercises.

Preparing for v3 of Exercism

If you are interesting in investing mid-term and long-term energy into this project, have a look at issue #280.

Adding Missing Exercise

All tracks share a common pool of exercises specified in exercism/problem-specifications repository. You can find a list of all missing exercises on tracks.exercism.io. Please read first Exercism documentation about implementing an exercise.

Before you start implementing a missing exercise, make sure your setup is already working.

bin/fetch-configlet # if not already retrieved
bin/configlet lint .
bin/build.sh

Then, the general steps for implementing a missing exercise are the following.

  1. Run the command bin/stub-new-exercise.sh <exercise-slug>
  2. Move into that exercise directory
  3. Replace placeholder names in src/ and tests/, rename src/<exercise>.elm accordingly
  4. Run elm-test to verify that everything is setup correctly
  5. Complete tests according to the canonical-data.json file of the exercise in exercism/problem-specifications
  6. Complete implementation of the solution in src/<exercise>.elm and check it passes all tests.
  7. Prepare files such that they are ready for student use:
    • Rename <exercise>.elm into <exercise>.example.elm
    • Prepare a starter file for students named <exercise>.elm. That is what exercise download will retrieve
    • Add skip <| to all tests except the first one so that students can progress gradually
  8. Update config.json file with an entry for this exercise.
    • Explanations regarding this file are provided in Exercism documentation
    • The uuid should be generated with the command bin/configlet uuid
  9. Check that everything is configured correctly and that builds pass by running bin/configlet lint . and bin/build.sh from the root of the directory
  10. Yeah! you can submit your PR

Make Up New Exercises

Follow instructions on Exercism documentation.

Elm icon

We were unable to find copyright information about the Elm logo, nor information about who designed it. Presumably Evan Czaplicki, creator of the Elm language, also made the logo, and holds copyright. It may also fall within the public domain, since it is a geometric shape. We've adapted the official Elm logo by changing the colors, which we believe falls under "fair use".

About

Exercism exercises in Elm.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Elm 98.0%
  • Shell 2.0%