{"id":15555758,"url":"https://github.com/unkindpartition/freemonad-benchmark","last_synced_at":"2025-04-15T23:45:53.029Z","repository":{"id":66223043,"uuid":"20561599","full_name":"UnkindPartition/freemonad-benchmark","owner":"UnkindPartition","description":null,"archived":false,"fork":false,"pushed_at":"2016-11-29T12:04:45.000Z","size":405,"stargazers_count":24,"open_issues_count":0,"forks_count":7,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-02-03T12:53:07.536Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"HTML","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/UnkindPartition.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}},"created_at":"2014-06-06T11:36:21.000Z","updated_at":"2023-04-10T07:03:06.000Z","dependencies_parsed_at":null,"dependency_job_id":"aa9de674-00de-417b-a38e-56201b76e58f","html_url":"https://github.com/UnkindPartition/freemonad-benchmark","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/UnkindPartition%2Ffreemonad-benchmark","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/UnkindPartition%2Ffreemonad-benchmark/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/UnkindPartition%2Ffreemonad-benchmark/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/UnkindPartition%2Ffreemonad-benchmark/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/UnkindPartition","download_url":"https://codeload.github.com/UnkindPartition/freemonad-benchmark/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246131246,"owners_count":20728299,"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":"2024-10-02T15:10:30.968Z","updated_at":"2025-03-29T02:46:15.684Z","avatar_url":"https://github.com/UnkindPartition.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"This repository exists for archival purposes only. I am not interested in\nmaintaining it. **Please do not open pull requests.**\n\n* * *\n\nA benchmark comparing the performance of different free monad implementations.\n\nThe benchmark simulates the state monad using various flavors of free monads,\nand compares them to the standard State monad from transformers.\n\nSee also: [Two failed attempts at extensible effects](https://ro-che.info/articles/2014-06-14-extensible-effects-failed).\n\nNote that this is *not* a comparison of extensible effects system. Free\nmonads *may* be used to implement an extensible effect system.\nUnder most implementations, extensible effects introduce an even bigger overhead\n(dispatching upon the effect requests); this overhead is not present in this\nbenchmark. However, if your free monad is slow (which it probably is, as this\nbenchmark shows), any effect system based on it won't be fast.\n\n## Running the benchmark\n\n    stack build \u0026\u0026 stack exec freemonad-benchmark -- -o results.html\n\n## Results\n\n[Criterion report](https://rawgit.com/feuerbach/freemonad-benchmark/master/results.html)\n\n## Implementations\n\n1. **Free**\n\n    ``` haskell\n    data Free f a = Pure a | Free (f (Free f a))\n    ```\n\n2. **Free/lazy**\n\n    The same standard Free monad emulating the lazy State monad.\n\n3. **Church**\n\n    The Church-encoded free monad:\n\n    ``` haskell\n    newtype ChurchFree f a = ChurchFree\n      { runChurchFree :: forall w. (a -\u003e w) -\u003e (f w -\u003e w) -\u003e w }\n    ```\n\n4. **Codensity**\n    \n    The standard Free monad, codensity-transformed. See\n    [Asymptotic Improvement of Computations over Free Monads](http://www.janis-voigtlaender.eu/papers/AsymptoticImprovementOfComputationsOverFreeMonads.pdf).\n\n5. **NoRemorse**\n\n    A free monad from [Reflection without Remorse](http://okmij.org/ftp/Haskell/zseq.pdf).\n\n6. **Freer**\n\n    The Freer monad from [Freer Monads, More Extensible\n    Effects](http://okmij.org/ftp/Haskell/extensible/more.pdf), aka the\n    [operational]() monad.\n\n## Workloads\n\nFor every implementation, there are two tests, for left- and right-associated\nchains of binds. Some free monads (e.g. the standard one) suffer from quadratic\ncomplexity on left-associated chains of binds.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Funkindpartition%2Ffreemonad-benchmark","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Funkindpartition%2Ffreemonad-benchmark","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Funkindpartition%2Ffreemonad-benchmark/lists"}