{"id":17978360,"url":"https://github.com/ad-si/purescript-result","last_synced_at":"2025-12-12T03:27:34.226Z","repository":{"id":58229711,"uuid":"117381102","full_name":"ad-si/purescript-result","owner":"ad-si","description":"Computations that may succeed or fail.","archived":false,"fork":false,"pushed_at":"2024-01-02T17:34:37.000Z","size":122,"stargazers_count":3,"open_issues_count":1,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-08-11T20:49:59.838Z","etag":null,"topics":["purescript","result"],"latest_commit_sha":null,"homepage":null,"language":"PureScript","has_issues":true,"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/ad-si.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}},"created_at":"2018-01-13T21:48:49.000Z","updated_at":"2024-06-17T17:59:46.000Z","dependencies_parsed_at":"2024-10-29T18:11:35.852Z","dependency_job_id":null,"html_url":"https://github.com/ad-si/purescript-result","commit_stats":null,"previous_names":["adius/purescript-result"],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/ad-si/purescript-result","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ad-si%2Fpurescript-result","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ad-si%2Fpurescript-result/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ad-si%2Fpurescript-result/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ad-si%2Fpurescript-result/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ad-si","download_url":"https://codeload.github.com/ad-si/purescript-result/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ad-si%2Fpurescript-result/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":27675596,"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-12-12T02:00:06.775Z","response_time":129,"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":["purescript","result"],"created_at":"2024-10-29T17:33:23.972Z","updated_at":"2025-12-12T03:27:34.198Z","avatar_url":"https://github.com/ad-si.png","language":"PureScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PureScript Result\n\n[![Latest release](http://img.shields.io/github/release/ad-si/purescript-result.svg)\n](https://github.com/ad-si/purescript-result/releases)\n[![Build status](https://travis-ci.org/ad-si/purescript-result.svg?branch=master)\n](https://travis-ci.org/ad-si/purescript-result)\n\nThe `Result` type is used to represent computations\nthat may succeed or fail.\n\nThis should be used instead of the more genereic `Either`.\n\nMany other functional programming languages also support Result types:\n\nLanguage | Type Name            | Success | Error | Documentation\n---------|----------------------|---------|-------|--------------\nElm      | `Result error value` | Ok      | Err   | [package.elm-lang.org][elm]\nRust     | `Result\u003cT, E\u003e`       | Ok      | Err   | [doc.rust-lang.org/book][rust]\nOCaml    | `('a, 'b) result`    | Ok      | Error | [ocaml.org/learn][ocaml]\nF#       | `Result\u003c'T,'TError\u003e` | Ok      | Error | [docs.microsoft.com][fsharp]\n\n[rust]: https://doc.rust-lang.org/book/ch09-02-recoverable-errors-with-result.html\n[elm]: https://package.elm-lang.org/packages/elm/core/latest/Result\n[ocaml]: https://ocaml.org/docs/error-handling#using-the-result-type-for-errors\n[fsharp]: https://learn.microsoft.com/en-us/dotnet/fsharp/language-reference/results\n\n\nI'm not a fan of useless abbreviations\n(as if 3 instead of 5 characters would make a difference) but\na fan of readability and pronounceability of code\n(e.g. dictating your coworker a snippet of code)\nand therefore this package uses:\n\n```purescript\ndata Result error value = Error error | Ok value\n```\n\n\nBecause how typeclasses work in PureScript it must be `Result error value`\nand not `Result value error`, so that the value can be `map`ed.\n([details])\n\n[details]: https://github.com/purescript/purescript/issues/3202#issuecomment-357465332\n\n\n## Installation\n\n```\nbower install --save purescript-result\n```\n\n\n## Documentation\n\nModule documentation is [published on Pursuit].\n\n[published on Pursuit]: http://pursuit.purescript.org/packages/purescript-result\n\n\n## Development\n\nDeployment of new version:\n\n```sh\nnpx pulp test\nnpx pulp version\nnpx pulp publish\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fad-si%2Fpurescript-result","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fad-si%2Fpurescript-result","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fad-si%2Fpurescript-result/lists"}