DictionaryK
public final class DictionaryK<K, A> : DictionaryKOf<K, A> where K : Hashable
DictionaryK is a Higher Kinded Type wrapper over Swift dictionaries.
-
Safe downcast.
Declaration
Swift
public static func fix(_ fa: DictionaryKOf<K, A>) -> DictionaryK<K, A>Parameters
faValue in the higher-kind form.
Return Value
Value cast to DictionaryK.
-
Initializes a
DictionaryK.Declaration
Swift
public init(_ dictionary: [K : A])Parameters
dictionaryA Swift dictionary.
-
Obtains the wrapped dictionary.
Declaration
Swift
public func asDictionary() -> [K : A]Return Value
A Swift dictionary wrapped in this value.
-
Zips this dictionary with another one and combines their values with the provided function.
Declaration
Swift
public func map2<B, Z>(_ fb: DictionaryK<K, B>, _ f: (A, B) -> Z) -> DictionaryK<K, Z>Parameters
fbA dictionary.
fCombining function.
Return Value
Result of zipping the values of both dictionaries and combining their values.
-
Zips this dictionary with a potentially lazy one and combines their values with the provided function.
Declaration
Parameters
fbA potentially lazy dictionary.
fCombining function.
Return Value
Result of zipping the values of both dictionaries and combining their values.
-
Sequential application.
Declaration
Swift
public func ap<AA, B>(_ fa: DictionaryK<K, AA>) -> DictionaryK<K, B> where A == (AA) -> BParameters
faA dictionary.
Return Value
A dictionary with the result of applying the functions in this dictionary to the values in the argument.
-
Applies the provided function to all values in this dictionary, flattening the final result.
Declaration
Swift
public func flatMap<B>(_ f: (A) -> DictionaryK<K, B>) -> DictionaryK<K, B>Parameters
fTransforming function.
Return Value
A dictionary with the outputs of applying the function to all values in this dictionary.
-
Declaration
Swift
public func combine(_ other: DictionaryK<K, A>) -> DictionaryK<K, A>
-
Declaration
Swift
public static func empty() -> DictionaryK<K, A>
Install in Dash
DictionaryK Class Reference