SwiftFu

1.0.1

➕ Swift Function Upgrades
0xLet/SwiftFu

What's New

1.0.1

2021-05-12T01:46:55Z

Protocols

Assertable

Boolable

Configurable

Functionable

Modifiable

Printable

Tuplable

Functions

switchmap

switcheffect

Math

BinaryFloatingPoint

BinaryInteger

Optional

func replace(nilWith value: Wrapped) -> Wrapped

Fuable

public protocol Fuable: Printable, Modifiable,
                 Boolable, Functionable,
                 Tuplable, Assertable { }
public protocol FuableClass: Fuable, Configurable { }

Swift + SwiftFu

extension Optional: Fuable { }

extension String: Fuable { }
extension Character: Fuable { }
extension Int: Fuable { }
extension Double: Fuable { }
extension Float: Fuable { }
extension Bool: Fuable { }

extension Array: Fuable { }
extension Dictionary: Fuable { }
extension Set: Fuable { }

Foundation + SwiftFu

extension Data: Fuable { }
extension Date: Fuable { }
extension URL: Fuable { }
extension URLRequest: Fuable { }

extension NSObject: FuableClass { }

SwiftFu

Swift Function Upgrades

Example

SomeClass()
    .modify { (object) in
        object.value = "Hello, World!"
    }
    .configure { (object) in
        object.value += "++"
    }
    .func { _ in
        SomeStruct(value: "New Value!")
    }
    .assert { (object) in
        object.value == "New Value!"
    }
    .sout()

Description

  • Swift Tools 5.3.0
View More Packages from this Author

Dependencies

  • None
Last updated: Fri Dec 16 2022 22:05:22 GMT-0500 (GMT-05:00)