ProductPromotion
Logo

Swift

made by https://0x3d.site

GitHub - typelift/Swiftx: Functional data types and functions for any project
Functional data types and functions for any project - typelift/Swiftx
Visit Site

GitHub - typelift/Swiftx: Functional data types and functions for any project

GitHub - typelift/Swiftx: Functional data types and functions for any project

Swiftx

Swiftx is a Swift library containing functional abstractions and extensions to the Swift Standard Library. Swiftx is a smaller and simpler way to introduce pure functional datatypes into any codebase.

For a more full-featured library checkout Swiftz.

Setup

Swiftx can be included one of two ways:

Framework

  • Drag Swiftx.xcodeproj or Swiftx-iOS.xcodeproj into your project tree as a subproject
  • Under your project's Build Phases, expand Target Dependencies
  • Click the + and add Swiftx
  • Expand the Link Binary With Libraries phase
  • Click the + and add Swiftx
  • Click the + at the top left corner to add a Copy Files build phase
  • Set the directory to Frameworks
  • Click the + and add Swiftx

Standalone

  • Copy the swift files under Swiftx/Swiftx into your project.

Introduction

Swiftx provides a number of common data types and abstractions any codebase can utilize.

A small example:

import Swiftx

let str : String? = .Some("Hello ")
let greeting = (+"World") <^> str // .Some("Hello World")

Seamless interaction with existing platform libraries is also possible with minimal effort:

import Foundation
import struct Swiftx.Result

/// result now contains either an array of file paths or the error generated by `NSFileManager`.
let result : Result<[String]> = from({ ep in
    let documentsDirectory : String = (NSSearchPathForDirectoriesInDomains(.DocumentDirectory, .UserDomainMask, true)[0] as String)
    return (NSFileManager.defaultManager().contentsOfDirectoryAtPath(documentsDirectory, error: ep) as [String]?) ?? []
})

Swiftx can even help with expressions of nothingness or errors:

import Swiftx

/// We may not be able to do what we said we'd do, but this definition compiles. At runtime, 
/// any code that invokes this function will immediately halt the program.
func provePEqualsNP() -> Proof<P, NP> {
    return undefined()
}

System Requirements

Swiftx supports OS X 10.9+ and iOS 8.0+.

License

Swiftx is released under the BSD license.

More Resources
to explore the angular.

mail [email protected] to add your project or resources here ๐Ÿ”ฅ.

Related Articles
to learn about angular.

FAQ's
to learn more about Angular JS.

mail [email protected] to add more queries here ๐Ÿ”.

More Sites
to check out once you're finished browsing here.

0x3d
https://www.0x3d.site/
0x3d is designed for aggregating information.
NodeJS
https://nodejs.0x3d.site/
NodeJS Online Directory
Cross Platform
https://cross-platform.0x3d.site/
Cross Platform Online Directory
Open Source
https://open-source.0x3d.site/
Open Source Online Directory
Analytics
https://analytics.0x3d.site/
Analytics Online Directory
JavaScript
https://javascript.0x3d.site/
JavaScript Online Directory
GoLang
https://golang.0x3d.site/
GoLang Online Directory
Python
https://python.0x3d.site/
Python Online Directory
Swift
https://swift.0x3d.site/
Swift Online Directory
Rust
https://rust.0x3d.site/
Rust Online Directory
Scala
https://scala.0x3d.site/
Scala Online Directory
Ruby
https://ruby.0x3d.site/
Ruby Online Directory
Clojure
https://clojure.0x3d.site/
Clojure Online Directory
Elixir
https://elixir.0x3d.site/
Elixir Online Directory
Elm
https://elm.0x3d.site/
Elm Online Directory
Lua
https://lua.0x3d.site/
Lua Online Directory
C Programming
https://c-programming.0x3d.site/
C Programming Online Directory
C++ Programming
https://cpp-programming.0x3d.site/
C++ Programming Online Directory
R Programming
https://r-programming.0x3d.site/
R Programming Online Directory
Perl
https://perl.0x3d.site/
Perl Online Directory
Java
https://java.0x3d.site/
Java Online Directory
Kotlin
https://kotlin.0x3d.site/
Kotlin Online Directory
PHP
https://php.0x3d.site/
PHP Online Directory
React JS
https://react.0x3d.site/
React JS Online Directory
Angular
https://angular.0x3d.site/
Angular JS Online Directory