{"id":20225532,"url":"https://github.com/purescript/purescript-refs","last_synced_at":"2026-01-31T03:02:50.279Z","repository":{"id":15194190,"uuid":"17922338","full_name":"purescript/purescript-refs","owner":"purescript","description":"Mutable value references","archived":false,"fork":false,"pushed_at":"2022-04-27T14:20:50.000Z","size":58,"stargazers_count":21,"open_issues_count":1,"forks_count":21,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-11-30T04:48:18.933Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"PureScript","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/purescript.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-03-19T22:12:38.000Z","updated_at":"2023-10-06T14:06:32.000Z","dependencies_parsed_at":"2022-07-20T21:32:11.257Z","dependency_job_id":null,"html_url":"https://github.com/purescript/purescript-refs","commit_stats":null,"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"purl":"pkg:github/purescript/purescript-refs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/purescript%2Fpurescript-refs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/purescript%2Fpurescript-refs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/purescript%2Fpurescript-refs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/purescript%2Fpurescript-refs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/purescript","download_url":"https://codeload.github.com/purescript/purescript-refs/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/purescript%2Fpurescript-refs/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28846249,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-28T15:15:36.453Z","status":"ssl_error","status_checked_at":"2026-01-28T15:15:13.020Z","response_time":57,"last_error":"SSL_read: 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":[],"created_at":"2024-11-14T07:13:18.637Z","updated_at":"2026-01-31T03:02:50.254Z","avatar_url":"https://github.com/purescript.png","language":"PureScript","readme":"# purescript-refs\n\n[![Latest release](http://img.shields.io/github/release/purescript/purescript-refs.svg)](https://github.com/purescript/purescript-refs/releases)\n[![Build status](https://github.com/purescript/purescript-refs/workflows/CI/badge.svg?branch=master)](https://github.com/purescript/purescript-refs/actions?query=workflow%3ACI+branch%3Amaster)\n[![Pursuit](https://pursuit.purescript.org/packages/purescript-refs/badge)](https://pursuit.purescript.org/packages/purescript-refs)\n\nThis module defines functions for working with mutable value references.\n\n_Note_: [`Control.Monad.ST`](https://pursuit.purescript.org/packages/purescript-st/4.0.0/docs/Control.Monad.ST) provides a _safe_ alternative to `Ref` when mutation is restricted to a local scope.\n\n## Installation\n\n```\nspago install refs\n```\n\n## Example\n\n```purs\nimport Effect.Ref as Ref\n\nmain = do\n  -- initialize a new Ref with the value 0\n  ref \u003c- Ref.new 0\n\n  -- read from it and check it\n  curr1 \u003c- Ref.read ref\n  assertEqual { actual: curr1, expected: 0 }\n\n  -- write over the ref with 1\n  Ref.write 1 ref\n\n  -- now it is 1 when we read out the value\n  curr2 \u003c- Ref.read ref\n  assertEqual { actual: curr2, expected: 1 }\n\n  -- modify it by adding 1 to the current state\n  Ref.modify_ (\\s -\u003e s + 1) ref\n\n  -- now it is 2 when we read out the value\n  curr3 \u003c- Ref.read ref\n  assertEqual { actual: curr3, expected: 2 }\n```\n\nSee [tests](test/Main.purs) to see usages.\n\n## Documentation\n\nModule documentation is [published on Pursuit](http://pursuit.purescript.org/packages/purescript-refs).\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpurescript%2Fpurescript-refs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpurescript%2Fpurescript-refs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpurescript%2Fpurescript-refs/lists"}