{"id":20879348,"url":"https://github.com/haskell-beginners-2022/exercises","last_synced_at":"2025-04-04T22:06:47.300Z","repository":{"id":37342250,"uuid":"439922598","full_name":"haskell-beginners-2022/exercises","owner":"haskell-beginners-2022","description":"💻 Exercises for the Haskell Beginners 2022 course","archived":false,"fork":false,"pushed_at":"2024-05-20T22:08:04.000Z","size":93,"stargazers_count":271,"open_issues_count":3,"forks_count":356,"subscribers_count":7,"default_branch":"main","last_synced_at":"2025-03-28T21:06:06.941Z","etag":null,"topics":["course","exercises","hacktoberfest","hacktoberfest2022","haskell","mentoring"],"latest_commit_sha":null,"homepage":"","language":"Haskell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/haskell-beginners-2022.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-12-19T17:13:09.000Z","updated_at":"2025-03-21T03:03:11.000Z","dependencies_parsed_at":"2024-12-14T04:06:51.430Z","dependency_job_id":null,"html_url":"https://github.com/haskell-beginners-2022/exercises","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/haskell-beginners-2022%2Fexercises","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/haskell-beginners-2022%2Fexercises/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/haskell-beginners-2022%2Fexercises/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/haskell-beginners-2022%2Fexercises/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/haskell-beginners-2022","download_url":"https://codeload.github.com/haskell-beginners-2022/exercises/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247256112,"owners_count":20909240,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["course","exercises","hacktoberfest","hacktoberfest2022","haskell","mentoring"],"created_at":"2024-11-18T07:16:08.686Z","updated_at":"2025-04-04T22:06:47.282Z","avatar_url":"https://github.com/haskell-beginners-2022.png","language":"Haskell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# exercises\n\n[![GitHub CI](https://github.com/haskell-beginners-2022/exercises/workflows/CI/badge.svg)](https://github.com/haskell-beginners-2022/exercises/actions)\n[![Hackage](https://img.shields.io/hackage/v/exercises.svg?logo=haskell)](https://hackage.haskell.org/package/exercises)\n[![MPL-2.0 license](https://img.shields.io/badge/license-MPL--2.0-blue.svg)](LICENSE)\n\n\u003e :warning: The course authors no longer provide reviews of the solutions.\n\u003e However, all the learning materials are free and publicly available.\n\u003e You can learn Haskell on your own or with the help of others.\n\nExercises for the Haskell Beginners 2022 course. The course itself can be found here:\n\n* [Haskell Beginners 2022 Course](https://github.com/haskell-beginners-2022/course-plan)\n\nThis repository contains a complete Haskell project. The project\ncomprises four Haskell files (modules) in the `src/` directory. Each\nmodule provides exercises for an individual lecture and has the\ncorresponding name (e.g. `Lecture1.hs`).\n\n## Working with the course\n\nThis section contains instructions about setting up the development\nenvironment and preparing the exercises repository.\n\n### First time\n\n1. [Fork the `exercises` repository](https://docs.github.com/en/free-pro-team@latest/github/getting-started-with-github/fork-a-repo).\n2. Enable GitHub Actions for your forked repository.\n    * Visit: `https://github.com/\u003cYOUR_GITHUB_USERNAME\u003e/exercises/actions`\n3. Clone your forked repository.\n4. Enter the `exercises` directory and add the original repository as a `course` remote.\n\n    ```shell\n    git remote add course https://github.com/haskell-beginners-2022/exercises\n    ```\n\n    You can verify that everything is done correctly by running the\n    `git remote -v` command. The output of this command will look\n    similar to the below:\n\n    ```shell\n    course https://github.com/haskell-beginners-2022/exercises (fetch)\n    course https://github.com/haskell-beginners-2022/exercises (push)\n    origin git@github.com:chshersh/exercises.git (fetch)\n    origin git@github.com:chshersh/exercises.git (push)\n    ```\n\n### Asking for feedback\n\nImplement your solutions in a separate branch (not `main`). You can\nrun the following command to create a new branch and switch to it at\nthe same time:\n\n```shell\ngit checkout -b lecture-1-solutions\n```\n\nWhen you have finished implementing exercises for a particular lecture,\ncreate a Pull Request to **your fork**. The repository already\ncontains PR template with the prefilled text and mentions all current\nmentors of the course.\n\n\u003e ℹ️**NOTE:** Open Pull Request to **your fork** and not this\n\u003e repository. We can't merge solutions to this repo. But if you open\n\u003e PRs to your repository, you can eventually merge all the solutions\n\u003e and enjoy green all-passing CI 🍏\n\nTo open a PR to your fork, you need to change _base repository_ to\nyour own repository, as shown on the screenshot below:\n\n![PR to fork example](https://user-images.githubusercontent.com/4276606/147921946-e9b84424-e76f-4f7a-8976-e33564ae1532.png)\n\nAfter you change, the PR view will change accordingly:\n\n![Final PR to fork](https://user-images.githubusercontent.com/4276606/147922107-78f80f23-e98c-47f8-8cb3-d20a8b2f771d.png)\n\n### Updating your fork\n\nThe course content (exercises, tests, configuration, etc.) might\nchange after you forked the course. To get the latest updates, follow\nthe below instructions:\n\n1. Switch to your `main` branch locally and make sure it's in sync\n   with the latest version of your fork on GitHub.\n\n    ```shell\n    git checkout main\n    git pull --rebase --prune\n    ```\n\n2. Fetch all the course changes and save them locally.\n\n    ```shell\n    git fetch course main\n    git rebase course/main\n    ```\n\n    \u003e NOTE: This stage may require you to resolve conflicts.\n\n3. Push local changes to your own fork.\n\n    ```shell\n    git push origin main --force\n    ```\n\n## Installing Haskell\n\nFollow the below instructions to configure the Haskell development\nenvironment.\n\n### Haskell Toolchain\n\nTo develop in Haskell, you need to install `ghcup`, `ghc` and `cabal`.\n\n1. Install [ghcup](https://www.haskell.org/ghcup/) and follow `ghcup`\n   instructions for successful installation (remember to restart your\n   terminal afterwards to avoid an `unknown ghcup command` error on\n   the next step).\n2. Install the recommended version of the Haskell compiler — GHC — and the\n   [Cabal](https://www.haskell.org/cabal/) build tool. After you install\n   `ghcup`, it is easy to install the rest with a few commands from your\n   terminal, if these tools are not yet installed.\n\n    ```shell\n    ghcup install ghc 9.2.5\n    ghcup set ghc 9.2.5\n    ghcup install cabal 3.8.1.0\n    ```\n\n\tYou can verify that everything is installed correctly by running\n    the following commands:\n\n    ```shell\n    $ ghc --version\n    The Glorious Glasgow Haskell Compilation System, version 9.2.5\n    $ cabal --version\n    cabal-install version 3.8.1.0\n    compiled using version 3.8.1.0 of the Cabal library\n    ```\n\n4. Run `cabal update` to fetch the latest info about Haskell packages.\n\n### Haskell IDE\n\nIf you don't have any IDE preferences, we recommend installing\n[Visual Studio Code](https://code.visualstudio.com/download) with the\n[Haskell plugin](https://marketplace.visualstudio.com/items?itemName=haskell.haskell).\nThe mentioned plugin would give you everything required to immediately start coding with Haskell.\n\n## How to build and test?\n\nThere're two ways to build this project: using either `cabal` or\n`stack` build tools. Using `cabal` is the recommended way. However, if\nit doesn't work, you may want to use `stack`.\n\n### Cabal\n\nTo compile the entire project, run the following command from your terminal:\n\n```shell\nmake build\n```\n\nTo run tests for a specific lecture only (e.g. the first one), use the\nfollowing command:\n\n```shell\nmake test-lecture1\n```\n\nYou can also run tests only for a single function. For example, to run\ntests for the `strSum` function, execute the following command:\n\n```shell\ncabal run exercises-test --enable-tests -- -m \"strSum\"\n```\n\n### Stack\n\nUse the [official `stack` installation instructions](https://docs.haskellstack.org/en/stable/install_and_upgrade/) to install `stack`.\n\nTo build the project with `stack`, run the following command:\n\n```shell\nstack build --test --no-run-tests\n```\n\nTo run tests for the first lecture, run the following commands:\n\n```shell\nstack test :doctest-lecture1\nstack test :exercises-test --test-arguments='-m \"Lecture 1\"'\n```\n\nAnd to tests a specific function, use:\n\n```shell\nstack test :exercises-test --test-arguments='-m \"strSum\"'\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhaskell-beginners-2022%2Fexercises","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhaskell-beginners-2022%2Fexercises","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhaskell-beginners-2022%2Fexercises/lists"}