Module keypaths

Module keypaths 

Source

Functions§

get
Produces a getter function for a given key path. Useful for composing property access with functions. Equivalent to Swift’s get<Root, Value>(_ keyPath: KeyPath<Root, Value>) -> (Root) -> Value
mprop
Produces an in-place setter function for a given key path. Useful for composing value property changes efficiently. Equivalent to Swift’s mprop<Root, Value>(_ keyPath: WritableKeyPath<Root, Value>) -> (@escaping (inout Value) -> Void) -> (inout Root) -> Void
mprop_ref
Produces a reference-mutable setter function for a given key path to a reference. Useful for composing reference property changes efficiently. Equivalent to Swift’s mprop<Root, Value>(_ keyPath: ReferenceWritableKeyPath<Root, Value>) -> (@escaping (Value) -> Void) -> (Root) -> Void where Value: AnyObject
mprop_ref_mut
Produces a reference-mutable setter function for a given key path to a value. Useful for composing reference property changes efficiently. Equivalent to Swift’s mprop<Root, Value>(_ keyPath: ReferenceWritableKeyPath<Root, Value>) -> (@escaping (inout Value) -> Void) -> (Root) -> Void
mut_set
Produces a value-mutable setter function for a given key path and new value. Equivalent to Swift’s mut<Root, Value>(_ keyPath: WritableKeyPath<Root, Value>, _ value: Value) -> (inout Root) -> Void
mut_set_ref
Produces a reference-mutable setter function for a given key path and new value. Equivalent to Swift’s mut<Root, Value>(_ keyPath: ReferenceWritableKeyPath<Root, Value>, _ value: Value) -> (Root) -> Void
mver
Uncurried mver. Takes a key path and update function all at once. Equivalent to Swift’s mver<Root, Value>(_ keyPath: WritableKeyPath<Root, Value>, _ update: @escaping (inout Value) -> Void) -> (inout Root) -> Void
mver_object
Uncurried mver. Takes a key path and update function all at once. Equivalent to Swift’s mverObject<Root, Value>(_ keyPath: ReferenceWritableKeyPath<Root, Value>, _ update: @escaping (Value) -> Void) -> (Root) -> Void where Value: AnyObject
mver_ref
Uncurried mver. Takes a key path and update function all at once. Equivalent to Swift’s mver<Root, Value>(_ keyPath: ReferenceWritableKeyPath<Root, Value>, _ update: @escaping (inout Value) -> Void) -> (Root) -> Void
over
Produces an immutable setter function for a given key path and update function. Equivalent to Swift’s over<Root, Value>(_ keyPath: WritableKeyPath<Root, Value>, _ update: @escaping (Value) -> Value) -> (Root) -> Root
prop
Produces an immutable setter function for a given key path. Useful for composing property changes. Equivalent to Swift’s prop<Root, Value>(_ keyPath: WritableKeyPath<Root, Value>) -> (@escaping (Value) -> Value) -> (Root) -> Root
set
Produces an immutable setter function for a given key path and constant value. Equivalent to Swift’s set<Root, Value>(_ keyPath: WritableKeyPath<Root, Value>, _ value: Value) -> (Root) -> Root