{"id":28558853,"url":"https://github.com/simre1/conio","last_synced_at":"2025-06-10T08:35:41.789Z","repository":{"id":297672565,"uuid":"997044244","full_name":"Simre1/conio","owner":"Simre1","description":"Easy concurrency in Haskell","archived":false,"fork":false,"pushed_at":"2025-06-06T18:55:25.000Z","size":16,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-06-06T19:26:14.218Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Haskell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Simre1.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":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-06-05T21:35:35.000Z","updated_at":"2025-06-06T18:55:26.000Z","dependencies_parsed_at":"2025-06-06T19:27:07.613Z","dependency_job_id":"9fe69061-6f73-4110-964e-59bd4ff0d752","html_url":"https://github.com/Simre1/conio","commit_stats":null,"previous_names":["simre1/conio"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Simre1%2Fconio","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Simre1%2Fconio/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Simre1%2Fconio/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Simre1%2Fconio/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Simre1","download_url":"https://codeload.github.com/Simre1/conio/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Simre1%2Fconio/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259039337,"owners_count":22796805,"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":[],"created_at":"2025-06-10T08:35:35.128Z","updated_at":"2025-06-10T08:35:41.782Z","avatar_url":"https://github.com/Simre1.png","language":"Haskell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ConIO\n\nHaskell has great tools for dealing with concurrency. However, in praxis they are difficult to use.\n\nThis library aims to make concurrency easy by providing many built-in solutions for common concurrency patterns.\nIt implements [structured concurrency](https://vorpus.org/blog/notes-on-structured-concurrency-or-go-statement-considered-harmful), not letting threads outlive their parent scope. Additionally, exceptions are propagated automatically. This means that you do not have to worry about:\n\n- Zombie processes, since a thread can never outlive its parent scope.\n- Dead processes, since exceptions will propagate to the parent thread.\n\n\n## Examples\n\n```haskell\nexample1 :: IO ()\nexample1 =\n  -- open up a concurrency scope\n  runConIO $ do\n    -- launch tasks\n    task1 \u003c- launch action1\n    task2 \u003c- launch action2\n    pure ()\n  -- waits until `action1` and `action2` are done\n```\n\n```haskell\nexample2 :: IO ()\nexample2 =\n  -- open up a concurrency scope\n  runConIO $ do\n    -- launch task\n    task \u003c- launch $ pure 10\n    \n    -- do some work\n    let x = 10\n\n    -- wait for task to complete and get the result\n    result \u003c- wait task\n\n    -- prints 20\n    print $ x + result\n```\n\n```haskell\nexample3 :: IO ()\nexample3 =\n  -- open up a concurrency scope\n  runConIO $ do\n    -- launch task\n    task \u003c- launch $ threadDelay 10000000\n\n    -- cancel task\n    cancel task\n```\n\n\n```haskell\nexample4 :: IO ()\nexample4 =\n  -- open up a concurrency scope\n  runConIO $ do\n    -- launch task\n    task \u003c- raceTwo (threadDelay 1000000 \u003e\u003e pure 10) (pure 20)\n\n    -- wait for result and cancel the slower thread\n    result \u003c- wait task\n\n    -- prints 20\n    print result\n```\n\n\n## Comparison with other libraries\n\n- `ki`: Implements structured concurrency, but has has no high-level functions\n- `async`: Does not implement structured concurrency\n\n## Acknowledgements\n\n- Inspired by [Notes on structured concurrency](https://vorpus.org/blog/notes-on-structured-concurrency-or-go-statement-considered-harmful), which is implemented in the `trio` Python library.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimre1%2Fconio","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsimre1%2Fconio","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimre1%2Fconio/lists"}