Swiftpack.co - P0ed/Fx as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by P0ed.
P0ed/Fx v3.0.0
Streams and friends
⭐️ 11
🕓 1 year ago
iOS macOS watchOS tvOS
.package(url: "https://github.com/P0ed/Fx.git", from: "v3.0.0")

Fx

codecov

This is a Swift framework providing a number of functions and types that I miss in Swift standard library.

Types:

Signal<A>

The Signal is a stream of values over time

Property<A> and MutableProperty<A>

The Property is a value + signal with changes

Promise<A>

The Promise is an async version of Result. Promises can be used instead of completion handlers to avoid nested closures.

Monoid

Any type that has empty value and can be comined.

Operators:

§ — Function application ⌥+6

— Function composition ⌥+8

— Prefix sum operator ⌥+W

Functions:

id

Identity function same as { $0 }

const

A constant function. Takes a value and returns a function that returns that value no matter what it is fed.

weakify

let f = weakify(self) { $0.handleEvent }

equals to

let f = { [weak self] in
	guard let self = self else { return }
	self.handleEvent($0)
}

curry

Currying takes a function of >1 parameter and returns a function of one parameter which returns a function of one parameter, and so on. That is, given (A, B) -> C, currying returns A -> B -> C.

Integration

⛔️ Carthage support is deprecated starting v3.0.0. Install using Swift Package Manager

GitHub

link
Stars: 11
Last commit: 4 weeks ago
Advertisement: IndiePitcher.com - Cold Email Software for Startups

Release Notes

v3.0.0 – Swift PM Support!
1 year ago

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics