{"id":25060089,"url":"https://github.com/stla/either","last_synced_at":"2025-03-31T11:15:30.083Z","repository":{"id":73101520,"uuid":"478090533","full_name":"stla/Either","owner":"stla","description":"The 'Either' type in R.","archived":false,"fork":false,"pushed_at":"2022-04-05T14:53:45.000Z","size":23,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-06T16:05:49.389Z","etag":null,"topics":["either","r","r6"],"latest_commit_sha":null,"homepage":"","language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/stla.png","metadata":{"files":{"readme":"README.Rmd","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":"2022-04-05T11:05:53.000Z","updated_at":"2022-06-03T23:07:44.000Z","dependencies_parsed_at":"2023-03-02T17:45:32.553Z","dependency_job_id":null,"html_url":"https://github.com/stla/Either","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/stla%2FEither","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stla%2FEither/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stla%2FEither/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stla%2FEither/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/stla","download_url":"https://codeload.github.com/stla/Either/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246458010,"owners_count":20780678,"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":["either","r","r6"],"created_at":"2025-02-06T15:56:41.899Z","updated_at":"2025-03-31T11:15:30.076Z","avatar_url":"https://github.com/stla.png","language":"R","funding_links":[],"categories":[],"sub_categories":[],"readme":"---\ntitle: 'Either: the ''Either'' type in R'\noutput: github_document\n---\n\n\u003c!-- badges: start --\u003e\n[![R-CMD-check](https://github.com/stla/Either/workflows/R-CMD-check/badge.svg)](https://github.com/stla/Either/actions)\n\u003c!-- badges: end --\u003e\n\n```{r setup, include=FALSE}\nknitr::opts_chunk$set(echo = TRUE, collapse = TRUE)\n```\n\n```{r package}\nlibrary(Either)\n```\n\n```{r}\n## ------------------------------------------------\n## Method `Either$new`\n## ------------------------------------------------\n\nEither$new(\"left\", 123)\n\n\n## ------------------------------------------------\n## Method `Either$isLeft`\n## ------------------------------------------------\n\nEither$new(\"right\", 999)$isLeft()\n\n## ------------------------------------------------\n## Method `Either$isRight`\n## ------------------------------------------------\n\nEither$new(\"right\", 999)$isRight()\n\n## ------------------------------------------------\n## Method `Either$getLeft`\n## ------------------------------------------------\n\nEither$new(\"right\", 999)$getLeft(\"abc\")\n\n## ------------------------------------------------\n## Method `Either$getRight`\n## ------------------------------------------------\n\nEither$new(\"right\", 999)$getRight(\"abc\")\n\n## ------------------------------------------------\n## Method `Either$toMaybe`\n## ------------------------------------------------\n\nEither$new(\"right\", 999)$toMaybe()\nEither$new(\"left\", 999)$toMaybe()\n\n## ------------------------------------------------\n## Method `Either$mapLeft`\n## ------------------------------------------------\n\nEither$new(\"left\", 999)$mapLeft(is.numeric)\nEither$new(\"right\", 999)$mapLeft(is.numeric)\n\n## ------------------------------------------------\n## Method `Either$mapRight`\n## ------------------------------------------------\n\nEither$new(\"left\", 999)$mapRight(is.numeric)\nEither$new(\"right\", 999)$mapRight(is.numeric)\n\n## ------------------------------------------------\n## Method `Either$either`\n## ------------------------------------------------\n\nEither$new(\"left\", 999)$either(is.numeric, is.character)\nEither$new(\"right\", 999)$either(is.numeric, is.character)\n```\n\n```{r}\n## ------------------------------------------------\n## Functions `Left` and `Right` (shortcuts)\n## ------------------------------------------------\nLeft(\"abc\")\nRight(\"abc\")\n```\n\n```{r, warning=FALSE}\n## ------------------------------------------------\n## Function `eitherFromMaybe` \n## ------------------------------------------------\nlibrary(maybe)\neitherFromMaybe(\"abc\", nothing())\neitherFromMaybe(\"abc\", just(123))\n```\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstla%2Feither","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstla%2Feither","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstla%2Feither/lists"}