{"id":1137,"url":"https://github.com/thoughtbot/Runes","last_synced_at":"2025-08-06T16:31:56.737Z","repository":{"id":25553195,"uuid":"28986245","full_name":"thoughtbot/Runes","owner":"thoughtbot","description":"Infix operators for monadic functions in Swift","archived":false,"fork":false,"pushed_at":"2021-09-24T16:04:00.000Z","size":252,"stargazers_count":830,"open_issues_count":3,"forks_count":65,"subscribers_count":45,"default_branch":"main","last_synced_at":"2024-11-30T21:02:54.538Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://thoughtbot.com/open-source","language":"Swift","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/thoughtbot.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-01-08T21:09:23.000Z","updated_at":"2024-11-02T17:58:45.000Z","dependencies_parsed_at":"2022-08-24T06:51:00.202Z","dependency_job_id":null,"html_url":"https://github.com/thoughtbot/Runes","commit_stats":null,"previous_names":[],"tags_count":23,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thoughtbot%2FRunes","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thoughtbot%2FRunes/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thoughtbot%2FRunes/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thoughtbot%2FRunes/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/thoughtbot","download_url":"https://codeload.github.com/thoughtbot/Runes/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228686176,"owners_count":17957032,"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-01-05T20:15:39.691Z","updated_at":"2024-12-09T16:31:18.347Z","avatar_url":"https://github.com/thoughtbot.png","language":"Swift","funding_links":[],"categories":["Functional Programming","Libs","Swift","Functions \u0026 Operators","Utility [🔝](#readme)"],"sub_categories":["Getting Started","Utility","Other free courses","Linter"],"readme":"\u003cimg src=\"https://raw.githubusercontent.com/thoughtbot/Runes/gh-pages/Logo.png\" width=\"200\" /\u003e\n\nIndecipherable symbols that some people claim have actual meaning.\n\n[![pod](https://img.shields.io/cocoapods/v/Runes.svg)](https://cocoapods.org/)\n[![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage)\n[![Swift Package Manager compatible](https://img.shields.io/badge/Swift%20Package%20Manager-compatible-brightgreen.svg)](https://github.com/apple/swift-package-manager)\n\nPlease see [the documentation] for [installation] instructions.\n\n[the documentation]: Documentation/\n[installation]: Documentation/installation.md\n\n## What's included? ##\n\nImporting Runes introduces several new operators and one global function that\ncorrespond to common Haskell typeclasses:\n\n### Functor ###\n\n- `\u003c^\u003e` (pronounced \"map\")\n\n### Applicative Functor ###\n\n- `\u003c*\u003e` (pronounced \"apply\")\n- `\u003c*` (pronounced \"left sequence\")\n- `*\u003e` (pronounced \"right sequence\")\n- `pure` (pronounced \"pure\")\n\n### Alternative ###\n\n- `\u003c|\u003e` (pronounced \"alternate\")\n- `empty` (pronounced \"empty\")\n\n### Monad ###\n\n- `\u003e\u003e-` (pronounced \"flatMap\") (left associative)\n- `-\u003c\u003c` (pronounced \"flatMap\") (right associative)\n- `\u003e-\u003e` (pronounced \"Monadic compose\") (left associative)\n- `\u003c-\u003c` (pronounced \"Monadic compose\") (right associative)\n\n### Implementations ###\n\nWe also include default implementations for Optional and Array with the\nfollowing type signatures:\n\n```swift\n// Optional+Functor:\npublic func \u003c^\u003e \u003cT, U\u003e(f: T -\u003e U, x: T?) -\u003e U?\n\n// Optional+Applicative:\npublic func \u003c*\u003e \u003cT, U\u003e(f: (T -\u003e U)?, x: T?) -\u003e U?\npublic func \u003c* \u003cT, U\u003e(lhs: T?, rhs: U?) -\u003e T?\npublic func *\u003e \u003cT, U\u003e(lhs: T?, rhs: U?) -\u003e U?\npublic func pure\u003cT\u003e(x: T) -\u003e T?\n\n// Optional+Alternative:\npublic func \u003c|\u003e \u003cT\u003e(lhs: T?, rhs: T?) -\u003e T?\npublic func empty\u003cT\u003e() -\u003e T?\n\n// Optional+Monad:\npublic func \u003e\u003e- \u003cT, U\u003e(x: T?, f: T -\u003e U?) -\u003e U?\npublic func -\u003c\u003c \u003cT, U\u003e(f: T -\u003e U?, x: T?) -\u003e U?\npublic func \u003e-\u003e \u003cT, U, V\u003e(f: T -\u003e U?, g: U -\u003e V?) -\u003e T -\u003e V?\npublic func \u003c-\u003c \u003cT, U, V\u003e(f: U -\u003e V?, g: T -\u003e U?) -\u003e T -\u003e V?\n\n// Array+Functor:\npublic func \u003c^\u003e \u003cT, U\u003e(f: T -\u003e U, x: [T]) -\u003e [U]\n\n// Array+Applicative:\npublic func \u003c*\u003e \u003cT, U\u003e(fs: [T -\u003e U], x: [T]) -\u003e [U]\npublic func \u003c* \u003cT, U\u003e(lhs: [T], rhs: [U]) -\u003e [T]\npublic func *\u003e \u003cT, U\u003e(lhs: [T], rhs: [U]) -\u003e [U]\npublic func pure\u003cT\u003e(x: T) -\u003e [T]\n\n// Array+Alternative:\npublic func \u003c|\u003e \u003cT\u003e(lhs: [T], rhs: [T]) -\u003e [T]\npublic func empty\u003cT\u003e() -\u003e [T]\n\n// Array+Monad:\npublic func \u003e\u003e- \u003cT, U\u003e(x: [T], f: T -\u003e [U]) -\u003e [U]\npublic func -\u003c\u003c \u003cT, U\u003e(f: T -\u003e [U], x: [T]) -\u003e [U]\npublic func \u003e-\u003e \u003cT, U, V\u003e(f: T -\u003e [U], g: U -\u003e [V]) -\u003e T -\u003e [V]\npublic func \u003c-\u003c \u003cT, U, V\u003e(f: U -\u003e [V], g: T -\u003e [U]) -\u003e T -\u003e [V]\n\n// Result+Functor:\npublic func \u003c^\u003e \u003cT, U, E\u003e(f: (T) -\u003e U, a: Result\u003cT, E\u003e) -\u003e Result\u003cU, E\u003e\n\n// Result+Applicative:\npublic func \u003c*\u003e \u003cT, U, E\u003e(f: Result\u003c(T) -\u003e U, E\u003e, a: Result\u003cT, E\u003e) -\u003e Result\u003cU, E\u003e\npublic func \u003c* \u003cT, U, E\u003e(lhs: Result\u003cT, E\u003e, rhs: Result\u003cU, E\u003e) -\u003e Result\u003cT, E\u003e\npublic func *\u003e \u003cT, U, E\u003e(lhs: Result\u003cT, E\u003e, rhs: Result\u003cU, E\u003e) -\u003e Result\u003cU, E\u003e\npublic func pure\u003cT, E\u003e(_ a: T) -\u003e Result\u003cT, E\u003e\n\n// Result+Alternative:\npublic func \u003c|\u003e \u003cT, E\u003e(lhs: Result\u003cT, E\u003e, rhs: @autoclosure () -\u003e Result\u003cT, E\u003e) -\u003e Result\u003cT, E\u003e\n\n// Result+Monad:\npublic func \u003e\u003e- \u003cT, U, E\u003e(a: Result\u003cT, E\u003e, f: (T) -\u003e Result\u003cU, E\u003e) -\u003e Result\u003cU, E\u003e\npublic func -\u003c\u003c \u003cT, U, E\u003e(f: (T) -\u003e Result\u003cU, E\u003e, a: Result\u003cT, E\u003e) -\u003e Result\u003cU, E\u003e\npublic func \u003e-\u003e \u003cT, U, V, E\u003e(f: @escaping (T) -\u003e Result\u003cU, E\u003e, g: @escaping (U) -\u003e Result\u003cV, E\u003e) -\u003e (T) -\u003e Result\u003cV, E\u003e\npublic func \u003c-\u003c \u003cT, U, V, E\u003e(f: @escaping (U) -\u003e Result\u003cV, E\u003e, g: @escaping (T) -\u003e Result\u003cU, E\u003e) -\u003e (T) -\u003e Result\u003cV, E\u003e\n```\n\n## Contributing ##\n\nSee the [CONTRIBUTING] document. Thank you, [contributors]!\n\n[CONTRIBUTING]: CONTRIBUTING.md\n[contributors]: https://github.com/thoughtbot/Runes/graphs/contributors\n\n## License ##\n\nRunes is Copyright (c) 2015 thoughtbot, inc. It is free software, and may be\nredistributed under the terms specified in the [LICENSE] file.\n\n[LICENSE]: /LICENSE\n\n## About ##\n\n![thoughtbot](https://thoughtbot.com/logo.png)\n\nRunes is maintained and funded by thoughtbot, inc. The names and logos for\nthoughtbot are trademarks of thoughtbot, inc.\n\nWe love open source software! See [our other projects][community] or look at\nour product [case studies] and [hire us][hire] to help build your iOS app.\n\n[community]: https://thoughtbot.com/community?utm_source=github\n[case studies]: https://thoughtbot.com/ios?utm_source=github\n[hire]: https://thoughtbot.com/hire-us?utm_source=github\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthoughtbot%2FRunes","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthoughtbot%2FRunes","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthoughtbot%2FRunes/lists"}