{"id":20642697,"url":"https://github.com/typelift/swiftx","last_synced_at":"2025-10-05T22:55:31.138Z","repository":{"id":26214165,"uuid":"29660580","full_name":"typelift/Swiftx","owner":"typelift","description":"Functional data types and functions for any project","archived":false,"fork":false,"pushed_at":"2019-11-21T10:29:40.000Z","size":296,"stargazers_count":220,"open_issues_count":4,"forks_count":28,"subscribers_count":12,"default_branch":"master","last_synced_at":"2025-04-02T11:04:36.617Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/typelift.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":"2015-01-22T05:23:52.000Z","updated_at":"2025-02-18T18:20:31.000Z","dependencies_parsed_at":"2022-08-01T08:39:48.482Z","dependency_job_id":null,"html_url":"https://github.com/typelift/Swiftx","commit_stats":null,"previous_names":[],"tags_count":16,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/typelift%2FSwiftx","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/typelift%2FSwiftx/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/typelift%2FSwiftx/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/typelift%2FSwiftx/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/typelift","download_url":"https://codeload.github.com/typelift/Swiftx/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248036067,"owners_count":21037092,"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-11-16T16:09:55.952Z","updated_at":"2025-10-05T22:55:26.061Z","avatar_url":"https://github.com/typelift.png","language":"Swift","readme":"Swiftx\n======\n\nSwiftx is a Swift library containing functional abstractions and extensions to\nthe Swift Standard Library.  Swiftx is a smaller and simpler way to introduce pure functional \ndatatypes into any codebase.\n\nFor a more full-featured library checkout [Swiftz](https://github.com/typelift/swiftz).\n\nSetup\n-----\n\nSwiftx can be included one of two ways:\n\n**Framework**\n\n- Drag `Swiftx.xcodeproj` or `Swiftx-iOS.xcodeproj` into your project tree as a subproject\n- Under your project's Build Phases, expand Target Dependencies\n- Click the + and add Swiftx\n- Expand the Link Binary With Libraries phase\n- Click the + and add Swiftx\n- Click the + at the top left corner to add a Copy Files build phase\n- Set the directory to `Frameworks`\n- Click the + and add Swiftx\n\n**Standalone**\n\n- Copy the swift files under `Swiftx/Swiftx` into your project.\n\nIntroduction\n------------\n\nSwiftx provides a number of common data types and abstractions any codebase can utilize.\n\nA small example:\n\n```swift\nimport Swiftx\n\nlet str : String? = .Some(\"Hello \")\nlet greeting = (+\"World\") \u003c^\u003e str // .Some(\"Hello World\")\n```\n\nSeamless interaction with existing platform libraries is also possible with\nminimal effort:\n\n```swift\nimport Foundation\nimport struct Swiftx.Result\n\n/// result now contains either an array of file paths or the error generated by `NSFileManager`.\nlet result : Result\u003c[String]\u003e = from({ ep in\n    let documentsDirectory : String = (NSSearchPathForDirectoriesInDomains(.DocumentDirectory, .UserDomainMask, true)[0] as String)\n    return (NSFileManager.defaultManager().contentsOfDirectoryAtPath(documentsDirectory, error: ep) as [String]?) ?? []\n})\n```\n\n\nSwiftx can even help with expressions of nothingness or errors:\n\n```swift\nimport Swiftx\n\n/// We may not be able to do what we said we'd do, but this definition compiles. At runtime, \n/// any code that invokes this function will immediately halt the program.\nfunc provePEqualsNP() -\u003e Proof\u003cP, NP\u003e {\n    return undefined()\n}\n```\n\nSystem Requirements\n===================\n\nSwiftx supports OS X 10.9+ and iOS 8.0+.\n\nLicense\n=======\n\nSwiftx is released under the BSD license.\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftypelift%2Fswiftx","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftypelift%2Fswiftx","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftypelift%2Fswiftx/lists"}