{"id":32318641,"url":"https://github.com/pisces/functionalswiftkit","last_synced_at":"2026-02-20T09:32:10.486Z","repository":{"id":56911773,"uuid":"169696726","full_name":"pisces/FunctionalSwiftKit","owner":"pisces","description":"This kit help you can write code as functional programming.","archived":false,"fork":false,"pushed_at":"2019-02-13T06:29:13.000Z","size":41,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-01T13:33:41.632Z","etag":null,"topics":["conditional-statements","functional-programming","grouped","optional","swift","unwrap"],"latest_commit_sha":null,"homepage":null,"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/pisces.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":"2019-02-08T07:00:28.000Z","updated_at":"2019-02-13T06:29:08.000Z","dependencies_parsed_at":"2022-08-20T19:50:35.818Z","dependency_job_id":null,"html_url":"https://github.com/pisces/FunctionalSwiftKit","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/pisces/FunctionalSwiftKit","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pisces%2FFunctionalSwiftKit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pisces%2FFunctionalSwiftKit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pisces%2FFunctionalSwiftKit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pisces%2FFunctionalSwiftKit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pisces","download_url":"https://codeload.github.com/pisces/FunctionalSwiftKit/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pisces%2FFunctionalSwiftKit/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":280610254,"owners_count":26360212,"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-10-23T02:00:06.710Z","response_time":142,"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":["conditional-statements","functional-programming","grouped","optional","swift","unwrap"],"created_at":"2025-10-23T11:31:53.170Z","updated_at":"2025-10-23T11:32:52.172Z","avatar_url":"https://github.com/pisces.png","language":"Swift","readme":"# FunctionalSwiftKit\n\n[![CI Status](https://img.shields.io/travis/pisces/FunctionalSwiftKit.svg?style=flat)](https://travis-ci.org/pisces/FunctionalSwiftKit)\n[![Version](https://img.shields.io/cocoapods/v/FunctionalSwiftKit.svg?style=flat)](https://cocoapods.org/pods/FunctionalSwiftKit)\n[![License](https://img.shields.io/cocoapods/l/FunctionalSwiftKit.svg?style=flat)](https://cocoapods.org/pods/FunctionalSwiftKit)\n[![Platform](https://img.shields.io/cocoapods/p/FunctionalSwiftKit.svg?style=flat)](https://cocoapods.org/pods/FunctionalSwiftKit)\n\n## Example\n\nTo run the example project, clone the repo, and run `pod install` from the Example directory first.\n\n## Using\n\n### Condition\n * You can use this instead of condition statement according to functional programming paradigm.\n * Ensures thread safety.\n * It is simple.\n * Global variable.\n\n#### Using single condition statement\n```swift\nif \u003c\u003ctrue or false\u003e\u003e {\n} else if \u003c\u003ctrue or false\u003e\u003e {\n} else {\n}\n```\n```swift\n  _if(\u003c\u003ctrue or false\u003e\u003e) {}\n  .elseif(\u003c\u003ctrue or false\u003e\u003e) {}\n  .else {}\n```\n\n#### Using multiple condition statements with chaining\n```swift\nif \u003c\u003ctrue or false\u003e\u003e {\n} else if \u003c\u003ctrue or false\u003e\u003e {\n} else {\n}\n\nif \u003c\u003ctrue or false\u003e\u003e {\n} else if \u003c\u003ctrue or false\u003e\u003e {\n} else {\n}\n```\n```swift\n  _if(\u003c\u003ctrue or false\u003e\u003e) {}\n  .elseif(\u003c\u003ctrue or false\u003e\u003e) {}\n  .else {}\n  .if(\u003c\u003ctrue or false\u003e\u003e) {}\n  .elseif(\u003c\u003ctrue or false\u003e\u003e) {}\n  .else {}\n```\n\n### Array extension\n * Here are some frequently used functions with array.\n\n```swift\n// Sample struct\nstruct Model: Hashable {\n    let uid: String\n    var hashValue: Int { return uid.hashValue }\n\n    static func ==(lhs: Model, rhs: Model) -\u003e Bool {\n        return lhs.uid == rhs.uid\n    }\n}\n```\n\n#### Using function 'grouped' with strings\n```swift\nlet source = [\"A\", \"A\", \"B\", \"C\"]\nlet grouped = source.grouped { $0 }\n// print -\u003e [\"A\": [\"A\", \"A\"], \"B\": [\"B\"], \"C\": [\"C\"]]\n```\n\n#### Using function 'grouped' with structs\n```swift\nlet source = [Model(uid: \"A\"), Model(uid: \"A\"), Model(uid: \"B\"), Model(uid: \"C\")]\nlet grouped = source.grouped { $0.uid }\n// print -\u003e [\"A\": [Model(uid: \"A\"), Model(uid: \"A\")], \"B\": [Model(uid: \"B\")], \"C\": [Model(uid: \"C\")]]\n```\n\n#### Using function 'subtracted'\n```swift\nlet source = [Model(uid: \"A\"), Model(uid: \"B\")]\nlet other = [Model(uid: \"A\")]\nlet subtracted = source.subtracted(other)\n// print -\u003e [Model(uid: \"B\")]\n```\n\n#### Using function 'uniqued'\n```swift\nlet source = [Model(uid: \"A\"), Model(uid: \"A\"), Model(uid: \"B\"), Model(uid: \"B\")]\nlet uniqued = source.uniqued()\n// print -\u003e [Model(uid: \"A\"), Model(uid: \"B\"), Model(uid: \"C\")]\n```\n\n### Optional extension\n * You can use unwrap of Optional instead of map when you don't need return element.\n\n```swift\nimport FunctionalSwiftKit\n\nfunc testUnwrap() {\n    let string: String? = \"string\"\n    string.unwrap { \u003c\u003cyour function for execution\u003e\u003e($0) }\n}\nfunc testEmpty() {\n    let string: String? = \"string\"\n    string\n      .map { print($0) }\n      .empty { print(\"empty\") }\n}\n```\n\n## Requirements\niOS Deployment Target 9.0 higher\n\n## Installation\n\nFunctionalSwiftKit is available through [CocoaPods](https://cocoapods.org). To install\nit, simply add the following line to your Podfile:\n\n```ruby\npod 'FunctionalSwiftKit'\n```\n\n### Carthage\n\n[Carthage](https://github.com/Carthage/Carthage) is a decentralized dependency manager that builds your dependencies and provides you with binary frameworks.\n\nYou can install Carthage with [Homebrew](http://brew.sh/) using the following command:\n\n```bash\n$ brew update\n$ brew install carthage\n```\n\nTo integrate FunctionalSwiftKit into your Xcode project using Carthage, specify it in your `Cartfile`:\n\n```ogdl\ngithub \"pisces/FunctionalSwiftKit\"\n```\n\nRun `carthage update` to build the framework and drag the built `FunctionalSwiftKit.framework` into your Xcode project.\n\n## Author\n\nSteve Kim, hh963103@gmail.com\n\n## License\n\nFunctionalSwiftKit is available under the BSD 2-Clause License license. See the LICENSE file for more info.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpisces%2Ffunctionalswiftkit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpisces%2Ffunctionalswiftkit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpisces%2Ffunctionalswiftkit/lists"}