{"id":24277669,"url":"https://github.com/nikdon/scalaz-interpreter","last_synced_at":"2026-06-08T10:01:59.951Z","repository":{"id":80099552,"uuid":"51535653","full_name":"nikdon/scalaz-interpreter","owner":"nikdon","description":"Co-products for Free monads","archived":false,"fork":false,"pushed_at":"2017-02-14T10:27:27.000Z","size":23,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-05T11:25:48.503Z","etag":null,"topics":["cats","free-monad","interpreter","scala","scalaz"],"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/nikdon.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":"2016-02-11T18:16:06.000Z","updated_at":"2017-02-14T10:27:29.000Z","dependencies_parsed_at":null,"dependency_job_id":"c2d29ad0-2f54-4bdd-8a3c-bc50999a85ef","html_url":"https://github.com/nikdon/scalaz-interpreter","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/nikdon/scalaz-interpreter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nikdon%2Fscalaz-interpreter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nikdon%2Fscalaz-interpreter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nikdon%2Fscalaz-interpreter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nikdon%2Fscalaz-interpreter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nikdon","download_url":"https://codeload.github.com/nikdon/scalaz-interpreter/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nikdon%2Fscalaz-interpreter/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34057158,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-08T02:00:07.615Z","response_time":111,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["cats","free-monad","interpreter","scala","scalaz"],"created_at":"2025-01-15T23:58:32.508Z","updated_at":"2026-06-08T10:01:59.920Z","avatar_url":"https://github.com/nikdon.png","language":"Scala","funding_links":[],"categories":[],"sub_categories":[],"readme":"# scalaz-interperter\n\n[![Build Status](https://travis-ci.org/nikdon/scalaz-interpreter.svg?branch=master)](https://travis-ci.org/nikdon/scalaz-interpreter)\n[![](https://jitpack.io/v/nikdon/scalaz-interpreter.svg)](https://jitpack.io/#nikdon/scalaz-interpreter)\n[![codecov.io](https://codecov.io/github/nikdon/scalaz-interpreter/coverage.svg?branch=master)](https://codecov.io/github/nikdon/scalaz-interpreter?branch=master)\n\nInterpreter implementation based on [**scalaz**](https://github.com/scalaz/scalaz) and [**cats**](https://github.com/typelevel/cats) inspired by Rúnar Bjarnason [Compositional Application Architecture With Reasonably Priced Monads](https://www.parleys.com/play/53a7d2c3e4b0543940d9e538/).\n\nCode based on **scalaz** and **cats** is almost the same except dependencies. Full examples are in tests.\n\nPrograms for interpretation in general look like this one:\n\n```scala\nclass ImplicitsTest extends FlatSpec with Matchers {\n\n  \"Implicit conversions\" should \"be used in the building of a programs\" in {\n\n    import com.github.nikdon.interpreter.scalaz.Implicits._\n    // import com.github.nikdon.interpreter.cats.Implicits._\n\n    def program[F[_]](implicit\n                      T1: Inject[EnglishSyntax, F],\n                      T2: Inject[JapaneseSyntax, F],\n                      T3: Inject[ChineseSyntax, F]) = for {\n      _ ← English.Say(\"The one says: 'Hi!'\")\n      _ ← Japanese.Say(\"Another one says: 'こんにちは'!\")\n      _ ← Chinese.Say(\"And somebody says: '嗨!'\")\n    } yield ()\n\n    type App[A] = Coproduct[EnglishSyntax, JapaneseSyntax, A]\n    type App1[A] = Coproduct[ChineseSyntax, App, A]\n    val prg: Free[App1, Unit] = program[App1]\n\n    val engJpInterpreter: App ~\u003e Id = EnglishInterpreter or JapaneseInterpreter\n    val chEngJpInterpreter: App1 ~\u003e Id = ChineseInterpreter or engJpInterpreter\n\n    prg.foldMap(chEngJpInterpreter)\n  }\n}\n```\n\nAnother way to create an interpreter is to use `HList` from [**shapeless**](https://github.com/milessabin/shapeless):\n\n```scala\nval interpreter: App1 ~\u003e Id = Fold(\n      (ChineseInterpreter: ChineseSyntax ~\u003e Id) ::\n      (EnglishInterpreter: EnglishSyntax ~\u003e Id) ::\n      (JapaneseInterpreter: JapaneseSyntax ~\u003e Id) :: HNil\n    )\n```\n\nOr `Fold.tupleN()` function:\n\n```scala\nval interpreter: App1 ~\u003e Id = Fold.tupleN(\n  ChineseInterpreter: ChineseSyntax ~\u003e Id,\n  EnglishInterpreter: EnglishSyntax ~\u003e Id,\n  JapaneseInterpreter: JapaneseSyntax ~\u003e Id\n)\n```\n\n## Getting Started\n\n```scala\nresolvers += \"jitpack\" at \"https://jitpack.io\"\n\nlibraryDependencies += \"com.github.nikdon\" % \"scalaz-interpreter\" % \"10630f3ca8\"\n```\n\n[![Analytics](https://ga-beacon.appspot.com/UA-91956314-1/scalaz-interpreter/readme?pixel)](https://github.com/igrigorik/ga-beacon)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnikdon%2Fscalaz-interpreter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnikdon%2Fscalaz-interpreter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnikdon%2Fscalaz-interpreter/lists"}