SetK

public final class SetK<A> : SetKOf<A> where A : Hashable

An unordered collection of unique elements, wrapped to act as a Higher Kinded Type.

  • Union of two sets.

    Declaration

    Swift

    public static func + (lhs: SetK<A>, rhs: SetK<A>) -> SetK<A>

    Parameters

    lhs

    Left hand side of the union.

    rhs

    Right hand side of the union.

    Return Value

    A new set that includes all elements present in both sets.

  • Safe downcast.

    Declaration

    Swift

    public static func fix(_ fa: SetKOf<A>) -> SetK<A>

    Parameters

    fa

    Value in the higher-kind form.

    Return Value

    Value cast to SetK.

  • Initializes a SetK with the elements of a Swift.Set.

    Declaration

    Swift

    public init(_ set: Set<A>)

    Parameters

    set

    A set of elements to be wrapped in this SetK.

  • Initializes a SetK from a variable number of elements.

    Declaration

    Swift

    public init(_ elements: A...)

    Parameters

    elements

    Values to be wrapped in this SetK.

  • Extracts a Swift.Set from this wrapper.

    Declaration

    Swift

    public var asSet: Set<A> { get }
  • Combines this set with another using the union of the underlying Swift.Sets.

    Declaration

    Swift

    public func combineK(_ y: SetK<A>) -> SetK<A>

    Parameters

    y

    A set

    Return Value

    A set containing the elements of the two sets.

  • Declaration

    Swift

    public func combine(_ other: SetK<A>) -> SetK<A>
  • Declaration

    Swift

    public static func empty() -> SetK<A>