{"id":17159163,"url":"https://github.com/scull7/result-type-simple","last_synced_at":"2025-10-29T09:11:46.405Z","repository":{"id":142121328,"uuid":"49199686","full_name":"scull7/result-type-simple","owner":"scull7","description":"A simple Result object type implementation that I like and want to use in several projects.","archived":false,"fork":false,"pushed_at":"2016-01-09T06:36:45.000Z","size":11,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-01T10:06:55.446Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"CoffeeScript","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/scull7.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}},"created_at":"2016-01-07T11:05:35.000Z","updated_at":"2016-01-09T00:59:05.000Z","dependencies_parsed_at":"2023-03-17T11:26:09.479Z","dependency_job_id":null,"html_url":"https://github.com/scull7/result-type-simple","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/scull7%2Fresult-type-simple","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scull7%2Fresult-type-simple/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scull7%2Fresult-type-simple/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scull7%2Fresult-type-simple/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/scull7","download_url":"https://codeload.github.com/scull7/result-type-simple/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245294712,"owners_count":20591898,"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-14T22:13:30.993Z","updated_at":"2025-10-29T09:11:46.310Z","avatar_url":"https://github.com/scull7.png","language":"CoffeeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Build Status](https://travis-ci.org/scull7/result-type-simple.svg)](https://travis-ci.org/scull7/result-type-simple)\n[![Coverage Status](https://coveralls.io/repos/scull7/result-type-simple/badge.svg?branch=master\u0026service=github)](https://coveralls.io/github/scull7/result-type-simple?branch=master)\n\n# result-type-simple\nA simple Result object type implementation that I like and want to use in several projects.\n\n### type Result a = Error String | OK a\n\nThe `Result` constructor takes an `err` and an `ok` parameter.\n\n* `err` - when provided the Result object is considered to be errored out.\n* `ok` - this will be the assigned value of the Result object.\n\n### `isOK` : Result a -\u003e Bool\n\nGiven a Result object determine if it is not an error.\n\n### `map` : (a -\u003e b) -\u003e Result a -\u003e Result b\n\nGiven a function that transforms the Result value from a -\u003e b, that function\nwill be applied if Result.isOK is true. Otherwise the original result will\nbe returned.\n\n### `either` (a -\u003e b) -\u003e (a -\u003e b) -\u003e Result a -\u003e Result b\n\nGiven 2 functions, the first function will be called when Result.isOK is false\nand the second when Result.isOK is true. Both functions will receive the \nResult object's value.\n\n### `chain` (Result a -\u003e Result b) -\u003e Result a -\u003e Result b\n\nGiven a function that returns a result map the unwrapped result value to the\ninput of that function.  The given function is responsible for returning\na Result object.  This can effectively be used as an unwrap function.\n\n### `curry` (a -\u003e a) -\u003e Result (really, it's just a guess at best)\n\nEnables you to curry the `map` and `either` functions with the curry library\nof your choice.\n\nExample (es6):\n\n```javascript\nimport { curry } from 'ramda';\nimport { curry as ResultCurry } from 'result-type-simple';\n\nconst Result = ResultCurry(curry);\n\n```\n\nExample (es5):\n\n```javascript\nvar curry = require('ramda').curry\nvar Result = require('result-type-simple').curry(curry);\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fscull7%2Fresult-type-simple","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fscull7%2Fresult-type-simple","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fscull7%2Fresult-type-simple/lists"}