{"id":15659613,"url":"https://github.com/robrix/freer-cofreer","last_synced_at":"2025-08-24T16:06:54.169Z","repository":{"id":66376732,"uuid":"80355026","full_name":"robrix/freer-cofreer","owner":"robrix","description":"freer monads and cofreer comonads.","archived":false,"fork":false,"pushed_at":"2018-06-26T16:12:45.000Z","size":89,"stargazers_count":23,"open_issues_count":6,"forks_count":1,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-08-23T22:49:24.871Z","etag":null,"topics":["comonads","haskell","monads"],"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/robrix.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":"2017-01-29T15:53:38.000Z","updated_at":"2025-08-01T18:36:45.000Z","dependencies_parsed_at":"2023-04-24T04:32:30.279Z","dependency_job_id":null,"html_url":"https://github.com/robrix/freer-cofreer","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/robrix/freer-cofreer","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robrix%2Ffreer-cofreer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robrix%2Ffreer-cofreer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robrix%2Ffreer-cofreer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robrix%2Ffreer-cofreer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/robrix","download_url":"https://codeload.github.com/robrix/freer-cofreer/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robrix%2Ffreer-cofreer/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271900779,"owners_count":24841114,"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","status":"online","status_checked_at":"2025-08-24T02:00:11.135Z","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":["comonads","haskell","monads"],"created_at":"2024-10-03T13:17:49.862Z","updated_at":"2025-08-24T16:06:54.153Z","avatar_url":"https://github.com/robrix.png","language":"Haskell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# freer-cofreer: freer monads and cofreer comonads.\n\nThis is an implementation of the Freer monad described by Oleg Kiselykov in _[Free and Freer Monads: Putting Monads Back in the Closet][Free and Freer]_, and the Cofreer comonad, defined by analogy with Freer.\n\n`Freer` and `Cofreer` differentiate themselves from `Free` and `Cofree` by admitting `Functor` \u0026 `Monad`/`Comonad` instances even when the signature is not a `Functor`. This makes them particularly suitable for working with certain GADTs. For example:\n\n```Haskell\ndata PromptF a where\n  Write :: String -\u003e PromptF ()\n  Read :: PromptF String\n\ntype Prompt = Freer PromptF\n\nwrite :: String -\u003e Prompt ()\nwrite s = Write s `Then` Return\n\nread :: Prompt String\nread = Read `Then` Return\n\ngreeting :: Prompt ()\ngreeting = do\n  write \"Hi! What’s your name?\\n\"\n  name \u003c- read\n  write $ \"Pleased to meet you, \" ++ name ++ \"!\"\n\nrunPrompt :: Prompt a -\u003e IO a\nrunPrompt = iterFreer (\\ yield instruction -\u003e case instruction of\n  Write s -\u003e putStrLn \u003e\u003e= yield\n  Read -\u003e getLine \u003e\u003e= yield)\n```\n\nThe constraints placed on the constructors of `PromptF` mean that it doesn’t admit a `Functor` instance, and thus is not very useful with `Free`. With `Freer`, you get `Functor`, `Applicative`, and `Monad` instances with `PromptF` “for free,” complete with the majority of the API defined in `Control.Monad.Free.Freer`.\n\n[Free and Freer]: http://okmij.org/ftp/Computation/free-monad.html\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frobrix%2Ffreer-cofreer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frobrix%2Ffreer-cofreer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frobrix%2Ffreer-cofreer/lists"}