{"id":17682356,"url":"https://github.com/moba1/maybe","last_synced_at":"2025-03-30T19:22:20.438Z","repository":{"id":80826147,"uuid":"182229229","full_name":"moba1/maybe","owner":"moba1","description":"Crystal maybe monad","archived":false,"fork":false,"pushed_at":"2019-04-19T09:02:14.000Z","size":5,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-05T21:57:54.159Z","etag":null,"topics":["crystal","crystal-lang","crystal-language","library"],"latest_commit_sha":null,"homepage":null,"language":"Crystal","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/moba1.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":"2019-04-19T08:18:19.000Z","updated_at":"2019-04-19T13:10:28.000Z","dependencies_parsed_at":null,"dependency_job_id":"524197bc-f374-4098-9633-4fea0025cf99","html_url":"https://github.com/moba1/maybe","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/moba1%2Fmaybe","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moba1%2Fmaybe/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moba1%2Fmaybe/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moba1%2Fmaybe/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/moba1","download_url":"https://codeload.github.com/moba1/maybe/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246366474,"owners_count":20765692,"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":["crystal","crystal-lang","crystal-language","library"],"created_at":"2024-10-24T09:13:37.371Z","updated_at":"2025-03-30T19:22:20.411Z","avatar_url":"https://github.com/moba1.png","language":"Crystal","funding_links":[],"categories":[],"sub_categories":[],"readme":"# maybe\n\nMaybe Monad for Crystal\n\n## Installation\n\n1. Add the dependency to your `shard.yml`:\n\n   ```yaml\n   dependencies:\n     maybe:\n       github: moba1/maybe\n   ```\n\n2. Run `shards install`\n\n## Usage\n\n```crystal\nrequire \"maybe\"\n\nj = Maybe::Just.new(1)\np j.to_s # ==\u003e Maybe::Just(Int32)(1)\np j.map { |x| x * 2 } # ==\u003e Maybe::Just(Int32)(2)\np j.or_else(3) # ==\u003e Maybe::Just(Int32)(1)\n\nn = Maybe::Nothig(String).new # require type parameter in order to infer type\np n.to_s # ==\u003e Maybe::Nothing(String)\np n.map { |x| x * 2 } # ==\u003e Maybe::Nothing(Int32)\np n.or_else(\"Nothing!\") # ==\u003e Maybe::Just(String)(\"Nothing!\")\n```\n\n## Contributing\n\n1. Fork it (\u003chttps://github.com/moba1/maybe/fork\u003e)\n2. Create your feature branch (`git checkout -b my-new-feature`)\n3. Commit your changes (`git commit -am 'Add some feature'`)\n4. Push to the branch (`git push origin my-new-feature`)\n5. Create a new Pull Request\n\n## Contributors\n\n- [Yuma Fukuda](https://github.com/moba1) - creator and maintainer\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmoba1%2Fmaybe","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmoba1%2Fmaybe","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmoba1%2Fmaybe/lists"}