{"id":16009475,"url":"https://github.com/fwcd/curry-functors","last_synced_at":"2026-03-03T09:08:35.274Z","repository":{"id":98824701,"uuid":"468594496","full_name":"fwcd/curry-functors","owner":"fwcd","description":"Contravariant functors, bifunctors, profunctors and more for Curry","archived":false,"fork":false,"pushed_at":"2022-03-11T20:45:22.000Z","size":14,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2026-02-15T16:40:08.983Z","etag":null,"topics":["bifunctor","bifunctors","curry","functor","functors","profunctors"],"latest_commit_sha":null,"homepage":"","language":"Curry","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/fwcd.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":"2022-03-11T03:28:08.000Z","updated_at":"2022-03-11T18:38:54.000Z","dependencies_parsed_at":"2023-05-25T16:00:38.322Z","dependency_job_id":null,"html_url":"https://github.com/fwcd/curry-functors","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/fwcd/curry-functors","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fwcd%2Fcurry-functors","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fwcd%2Fcurry-functors/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fwcd%2Fcurry-functors/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fwcd%2Fcurry-functors/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fwcd","download_url":"https://codeload.github.com/fwcd/curry-functors/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fwcd%2Fcurry-functors/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30038671,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-03T06:58:30.252Z","status":"ssl_error","status_checked_at":"2026-03-03T06:58:15.329Z","response_time":61,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["bifunctor","bifunctors","curry","functor","functors","profunctors"],"created_at":"2024-10-08T13:02:25.391Z","updated_at":"2026-03-03T09:08:35.269Z","avatar_url":"https://github.com/fwcd.png","language":"Curry","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Functors for Curry\n\nThis package adds a range of more or less exotic functors to Curry, including contravariant functors, bifunctors and profunctors.\n\n## Contravariant functors\n\nContravariant functors, as known from [Haskell](https://hackage.haskell.org/package/base-4.16.0.0/docs/Data-Functor-Contravariant.html), are functors that 'flip' the direction of the mapped function:\n\n```curry\nclass Contravariant f where\n  contramap :: (a -\u003e b) -\u003e f b -\u003e f a\n```\n\nA simple example of a bifunctor is a regular function where the functor maps over the _argument_ rather than the _result_.\n\n## Bifunctors\n\nBifunctors, as known from [Haskell](https://hackage.haskell.org/package/base-4.16.0.0/docs/Data-Bifunctor.html), are (covariant) functors over types with two arguments:\n\n```curry\nclass Bifunctor p where\n  -- | Maps over both arguments at the same time.\n  bimap :: (a -\u003e b) -\u003e (c -\u003e d) -\u003e p a c -\u003e p b d\n```\n\nExamples of bifunctors are `Either` and `(,)` (2-ary tuples).\n\n## Profunctors\n\nProfunctors, as known from [Haskell](https://hackage.haskell.org/package/profunctors-5.6.2/docs/Data-Profunctor.html), are functors over types with two arguments where the first argument is _contravariant_ and the second argument is _covariant_ (compare this to bifunctors where both arguments are covariant):\n\n```curry\nclass Profunctor p where\n  -- | Maps over both arguments at the same time.\n  dimap :: (a -\u003e b) -\u003e (c -\u003e d) -\u003e p b c -\u003e p a d\n```\n\nAn example of a profunctor is `(-\u003e)` (functions).\n\n## Comonads\n\nComonads, as known from [Haskell](https://hackage.haskell.org/package/comonad-5.0.8/docs/Control-Comonad.html), are the dual of monads, i.e. monads construct and comonads deconstruct:\n\n```curry\nclass Functor w =\u003e Comonad w where\n  extract :: w a -\u003e a\n  duplicate :: w a -\u003e w (w a)\n```\n\n## Credits\n\nThe modules are adapted from BSD-licensed code from Haskell's [`base` libraries](https://hackage.haskell.org/package/base) and related packages ([`bifunctors`](https://hackage.haskell.org/package/bifunctors), [`profunctors`](https://hackage.haskell.org/package/profunctors), [`comonad`](https://hackage.haskell.org/package/comonad)) under the following copyrights:\n\n| Module | Copyright |\n| ------ | --------- |\n| `Control.Comonad` | (C) 2008-2015 Edward Kmett, (C) 2004 Dave Menendez |\n| `Data.Bifunctor` | (C) 2008-2014 Edward Kmett |\n| `Data.Biapplicative` | (C) 2011-2015 Edward Kmett |\n| `Data.Functor.Compose` | (c) Ross Paterson 2010 |\n| `Data.Functor.Const` | Conor McBride and Ross Paterson 2005 |\n| `Data.Functor.Contravariant` | (C) 2007-2015 Edward Kmett |\n| `Data.Functor.Sum` | (c) Ross Paterson 2014 |\n| `Data.Functor.Product` | \t(c) Ross Paterson 2010 |\n| `Data.Profunctor` | (C) 2011-2018 Edward Kmett |\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffwcd%2Fcurry-functors","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffwcd%2Fcurry-functors","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffwcd%2Fcurry-functors/lists"}