{"id":28959604,"url":"https://github.com/tofu-tf/volga","last_synced_at":"2026-01-11T17:58:32.579Z","repository":{"id":52403843,"uuid":"179871784","full_name":"tofu-tf/volga","owner":"tofu-tf","description":"Comprehensions for Arrows and Monoidal categories","archived":false,"fork":false,"pushed_at":"2025-06-17T10:27:48.000Z","size":325,"stargazers_count":61,"open_issues_count":2,"forks_count":6,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-06-17T10:35:45.394Z","etag":null,"topics":["arrows","comprehension","linear-types","macros","scala","symmetric-monoidal-categories"],"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/tofu-tf.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,"zenodo":null}},"created_at":"2019-04-06T18:33:08.000Z","updated_at":"2025-06-17T10:27:44.000Z","dependencies_parsed_at":"2023-02-17T22:31:09.684Z","dependency_job_id":"60e5bd76-185b-4a8a-ba50-dbd6f9a5aede","html_url":"https://github.com/tofu-tf/volga","commit_stats":null,"previous_names":["tofu-tf/volga"],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/tofu-tf/volga","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tofu-tf%2Fvolga","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tofu-tf%2Fvolga/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tofu-tf%2Fvolga/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tofu-tf%2Fvolga/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tofu-tf","download_url":"https://codeload.github.com/tofu-tf/volga/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tofu-tf%2Fvolga/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261577986,"owners_count":23179767,"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":["arrows","comprehension","linear-types","macros","scala","symmetric-monoidal-categories"],"created_at":"2025-06-24T00:03:01.562Z","updated_at":"2026-01-11T17:58:32.574Z","avatar_url":"https://github.com/tofu-tf.png","language":"Scala","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Volga\n\n| Release | \n| --- |\n| [![Maven Central](https://img.shields.io/maven-central/v/org.manatki/volga-macros_2.13.svg)](https://search.maven.org/search?q=org.manatki.volga) | \n\nArrow and Symmetric Monoidal Category composition syntax helper\n\n## How to use:\nLet's say you have ` type Process[Input, Output]`, you want to use process comprehensions for your type\n\n1. Define volga.Arr or volga.Symon instance for your type\n2. Import syntax extensions\n    ```scala\n    import volga.syntax.comp._\n    import volga.syntax.cat._\n    import volga.syntax.symon._ \n    // or import volga.syntax.arr._\n    ```\n3. Prepare syntax composer for your type\n    ```scala\n        val process = arr[Process]\n    ```\n    or\n    ```scala\n        val process = symon[Process, Pair, One]\n    ```\n    where `Pair` and `One` are tensor product type constructor and unit type for your Symon instance\n4. write your arrows\n    ```scala\n    val someProcess1: Process[Pair[A,B], Pair[X, Y]] = ...\n    val someProcess2: Process[Pair[C, X], Z] = ...\n    val someProcess3: Process[One, D] = ...\n    val someProcess4: Process[Y, One] = ...\n    val someProcess5: Process[Z, E] = ...\n   \n    val myProcess: Process[Pair[Pair[A, B], C], Pair[D, E]] = process{ (a, b, c) =\u003e\n        val (x, y) = someProcess1(a, b)\n        val z = someProcess2(c, x)\n        ----\n        val d = someProcess3()\n        someProcess4(y)\n        val e = someProcess5(z)\n        (d, e)\n    }\n    ```\n\n## Syntactic rules\n\n1. a comprehension for arrow\n\n    ```scala\n    proc: (X1, X2, ...) -\u003e (Y1, Y2, ...)\n    ```\n    or monoidal morphism (note left associativity of products)\n    ```scala\n    proc: (Tensor(...(Tensor(X1, X2), ...) -\u003e Tensor(...Tensor(Y1, Y2),..)\n    ``` \n    should form a lambda function having parameters of types `(V[X1], V[X2], ...) =\u003e`\n\n2. last line in comprenension defined in (1.)\n\n    should be in the form `(y1, y2, ...)` \n    or non-assigning application\n    `someProcess(z1, z2, ...)` where `someProcess` is an arrow\n    ```scala\n    proc: (Z1, Z2, ...) -\u003e (Y1, Y2, ...)\n    ```\n    or monoidal morphism (note left associativity of products)\n    ```scala\n    proc: (Tensor(...(Tensor(Z1, Z2), ...) -\u003e Tensor(...Tensor(Y1, Y2),..)\n    ``` \n  \n3. to use some arrow  \n\n    ```scala\n    proc: (X1, X2, ...) -\u003e (Y1, Y2, ...)\n    ```\n    or monoidal morphism (note left associativity of products)\n    ```scala\n    proc: (Tensor(...(Tensor(X1, X2), ...) -\u003e Tensor(...Tensor(Y1, Y2),..)\n    ``` \n    you can write\n    ```\n    val (y1, y2, ...) = proc(x1, x2, ...)\n    ```\n  \n4. non-assigning construction\n\n    ```scala\n    proc(x1, x2, ...)\n    ```\n    could be used to dispose of the result of an arrow, or use morphism with unit domain\n\n5. special block-separator\n\n    ```scala\n     ----\n     ```\n     could be used to enforce the end of parallel block\n\n## Additional rules for symmetric monoidal categories\n\n1.  Any variable defined in the lambda parameter clause \nor extracted as a result of morphism application should be used **exactly one time**\n\n\n## Limitations.\n\nVolga syntax works by extending \nyour arrows and morphisms with the `apply`\nmethods which then are analyzed by the macros.\n\nTypes which have `apply` method already\ni.e. `Function1` and `cats.data.Kleisli` \nmay not work. \nConsider volga.data.Kleisli instead.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftofu-tf%2Fvolga","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftofu-tf%2Fvolga","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftofu-tf%2Fvolga/lists"}