{"id":17597312,"url":"https://github.com/battermann/parser-combinators-scala-hands-on","last_synced_at":"2025-03-29T20:26:24.065Z","repository":{"id":86688943,"uuid":"119904445","full_name":"battermann/parser-combinators-scala-hands-on","owner":"battermann","description":"A series of exercises on functional parsers","archived":false,"fork":false,"pushed_at":"2020-04-27T20:59:02.000Z","size":10,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":4,"default_branch":"exercises","last_synced_at":"2025-02-04T21:20:24.680Z","etag":null,"topics":["functional-programming","hands-on","parser-combinators","property-based-testing","scala","tutorial"],"latest_commit_sha":null,"homepage":"","language":"Scala","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/battermann.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-02-01T23:04:23.000Z","updated_at":"2023-03-02T03:01:40.000Z","dependencies_parsed_at":null,"dependency_job_id":"f3436819-f8b1-4783-aabb-0f3a97879fe5","html_url":"https://github.com/battermann/parser-combinators-scala-hands-on","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/battermann%2Fparser-combinators-scala-hands-on","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/battermann%2Fparser-combinators-scala-hands-on/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/battermann%2Fparser-combinators-scala-hands-on/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/battermann%2Fparser-combinators-scala-hands-on/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/battermann","download_url":"https://codeload.github.com/battermann/parser-combinators-scala-hands-on/tar.gz/refs/heads/exercises","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246239826,"owners_count":20745773,"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":["functional-programming","hands-on","parser-combinators","property-based-testing","scala","tutorial"],"created_at":"2024-10-22T09:24:48.091Z","updated_at":"2025-03-29T20:26:24.042Z","avatar_url":"https://github.com/battermann.png","language":"Scala","funding_links":[],"categories":[],"sub_categories":[],"readme":"# A Hands On Functional Parsers In Scala\n\n\u003e A hands on functional parsers in Scala based on \"Programming in Haskell\" by Graham Hutton.\n\n## Prerequisites\n\n- Install [Ammonite](https://ammonite.io/#ScalaScripts)\n\n## How To\n\nThis repo has two branches, `exercises` and `solutions`.\n\nCheckout the `exercises` branch and run the tests with `amm -w test.sc`.\n\nYou should get an output similar to this:\n\n```text\ntests$ParserTests:\n- fail should always fail\n- succeed should always succeed with the result value v (pending)\n- anyChar should succeed with first char for non empty inputs (pending)\n- anyChar should fail if input is empty (pending)\n- sequencing (pending)\n…\n```\n\nNow, take look at the tests in `tests.sc`. Here is an example:\n\n```scala\nproperty(\"fail should always fail\") {\n  pending\n  forAll { (input: String) =\u003e\n    parser.fail(input) should ===(None)\n  }\n}\n```\n\n- Go from top to bottom\n- Remove the line which says `pending` from the first pending test\n- This should usually make the test fail (red)\n- Now implement the function under test (in `parser.sc` and `expr_parser.sc`) and try to make the test pass (green)\n- Think about if you can improve your implementation (refactor)\n- Work through the tests from top to bottom until all tests pass\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbattermann%2Fparser-combinators-scala-hands-on","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbattermann%2Fparser-combinators-scala-hands-on","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbattermann%2Fparser-combinators-scala-hands-on/lists"}