{"id":13723182,"url":"https://github.com/palladin/Eff","last_synced_at":"2025-05-07T16:32:22.712Z","repository":{"id":36368488,"uuid":"40673319","full_name":"palladin/Eff","owner":"palladin","description":"A library for programming with Algebraic Effects in F# ","archived":false,"fork":false,"pushed_at":"2017-12-18T13:31:24.000Z","size":41,"stargazers_count":100,"open_issues_count":0,"forks_count":4,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-04-13T02:28:31.142Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"F#","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/palladin.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}},"created_at":"2015-08-13T17:48:02.000Z","updated_at":"2025-01-28T23:06:06.000Z","dependencies_parsed_at":"2022-09-10T01:20:11.198Z","dependency_job_id":null,"html_url":"https://github.com/palladin/Eff","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/palladin%2FEff","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/palladin%2FEff/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/palladin%2FEff/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/palladin%2FEff/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/palladin","download_url":"https://codeload.github.com/palladin/Eff/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252915457,"owners_count":21824566,"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-08-03T01:01:36.963Z","updated_at":"2025-05-07T16:32:17.701Z","avatar_url":"https://github.com/palladin.png","language":"F#","funding_links":[],"categories":["F#"],"sub_categories":[],"readme":"# Eff\nEff is a library for programming with Algebraic Effects in F# inspired by the [Eff] programming language and the implementation of Algebraic Effects in [OCaml]-Haskell([1], [2]) and especially from the paper [Eff Directly in OCaml].\n\n``` fsharp\n// state effect example\nlet test () = \n    eff {\n        let! x = get ()\n        do! put (x + 1)\n        let! y = get ()\n        do! put (y + y)\n        return! get ()\n    } \n    \n// state effect handler\nlet stateHandler (s : 'S) (eff : Eff\u003c#State\u003c'S\u003e, 'T\u003e) : ('T * 'S) =\n    let rec loop (s : 'S) (effect : Effect) = \n        match effect with\n        | :? Get\u003c'S\u003e as get -\u003e loop s (get.K s) \n        | :? Put\u003c'S\u003e as put -\u003e loop put.Value (put.K ())\n        | :? Done\u003c'T\u003e as done' -\u003e (done'.Value, s)\n        | _ -\u003e failwith \"Unhandled effect\"\n    loop s (run done' eff) \n\n// Apply state effect and execute\nstateHandler 1 (test ()) // (4, 4)\n```\n\n\n[Eff]: http://math.andrej.com/wp-content/uploads/2012/03/eff.pdf\n[OCaml]: http://www.lpw25.net/ocaml2015-abs2.pdf\n[1]: http://homepages.inf.ed.ac.uk/slindley/papers/handlers.pdf\n[2]: http://okmij.org/ftp/Haskell/extensible/more.pdf\n[Eff Directly in OCaml]: http://kcsrk.info/papers/eff_ocaml_ml16.pdf\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpalladin%2FEff","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpalladin%2FEff","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpalladin%2FEff/lists"}