Coproduct10

public final class Coproduct10<A, B, C, D, E, F, G, H, I, J> : Coproduct10Of<A, B, C, D, E, F, G, H, I, J>

Represents a sum type of 10 different types.

  • Creates an instance of a coproduct providing a value of the first type.

    Declaration

    Swift

    public static func first(_ a: A) -> Coproduct10<A, B, C, D, E, F, G, H, I, J>

    Parameters

    a

    Value of the first type of the coproduct.

    Return Value

    A coproduct with a value of the first type.

  • Creates an instance of a coproduct providing a value of the second type.

    Declaration

    Swift

    public static func second(_ b: B) -> Coproduct10<A, B, C, D, E, F, G, H, I, J>

    Parameters

    b

    Value of the second type of the coproduct.

    Return Value

    A coproduct with a value of the second type.

  • Creates an instance of a coproduct providing a value of the third type.

    Declaration

    Swift

    public static func third(_ c: C) -> Coproduct10<A, B, C, D, E, F, G, H, I, J>

    Parameters

    c

    Value of the third type of the coproduct.

    Return Value

    A coproduct with a value of the third type.

  • Creates an instance of a coproduct providing a value of the fourth type.

    Declaration

    Swift

    public static func fourth(_ d: D) -> Coproduct10<A, B, C, D, E, F, G, H, I, J>

    Parameters

    d

    Value of the fourth type of the coproduct.

    Return Value

    A coproduct with a value of the fourth type.

  • Creates an instance of a coproduct providing a value of the fifth type.

    Declaration

    Swift

    public static func fifth(_ e: E) -> Coproduct10<A, B, C, D, E, F, G, H, I, J>

    Parameters

    e

    Value of the fifth type of the coproduct.

    Return Value

    A coproduct with a value of the fifth type.

  • Creates an instance of a coproduct providing a value of the sixth type.

    Declaration

    Swift

    public static func sixth(_ f: F) -> Coproduct10<A, B, C, D, E, F, G, H, I, J>

    Parameters

    f

    Value of the sixth type of the coproduct.

    Return Value

    A coproduct with a value of the sixth type.

  • Creates an instance of a coproduct providing a value of the seventh type.

    Declaration

    Swift

    public static func seventh(_ g: G) -> Coproduct10<A, B, C, D, E, F, G, H, I, J>

    Parameters

    g

    Value of the seventh type of the coproduct.

    Return Value

    A coproduct with a value of the seventh type.

  • Creates an instance of a coproduct providing a value of the eighth type.

    Declaration

    Swift

    public static func eighth(_ h: H) -> Coproduct10<A, B, C, D, E, F, G, H, I, J>

    Parameters

    h

    Value of the eighth type of the coproduct.

    Return Value

    A coproduct with a value of the eighth type.

  • Creates an instance of a coproduct providing a value of the ninth type.

    Declaration

    Swift

    public static func ninth(_ i: I) -> Coproduct10<A, B, C, D, E, F, G, H, I, J>

    Parameters

    i

    Value of the ninth type of the coproduct.

    Return Value

    A coproduct with a value of the ninth type.

  • Creates an instance of a coproduct providing a value of the tenth type.

    Declaration

    Swift

    public static func tenth(_ j: J) -> Coproduct10<A, B, C, D, E, F, G, H, I, J>

    Parameters

    j

    Value of the tenth type of the coproduct.

    Return Value

    A coproduct with a value of the tenth type.

  • Applies a function depending on the content of the coproduct.

    Declaration

    Swift

    public func fold<Z>(_ fa: (A) -> Z,
                        _ fb: (B) -> Z,
                        _ fc: (C) -> Z,
                        _ fd: (D) -> Z,
                        _ fe: (E) -> Z,
                        _ ff: (F) -> Z,
                        _ fg: (G) -> Z,
                        _ fh: (H) -> Z,
                        _ fi: (I) -> Z,
                        _ fj: (J) -> Z) -> Z

    Parameters

    fa

    Function to apply with a value of the first type.

    fb

    Function to apply with a value of the second type.

    fc

    Function to apply with a value of the third type.

    fd

    Function to apply with a value of the fourth type.

    fe

    Function to apply with a value of the fifth type.

    ff

    Function to apply with a value of the sixth type.

    fg

    Function to apply with a value of the seventh type.

    fh

    Function to apply with a value of the eighth type.

    fi

    Function to apply with a value of the ninth type.

    fj

    Function to apply with a value of the tenth type.

    Return Value

    A value resulting of the application of the corresponding function based on the content of the coproduct.

  • Retrieves the value of the first type, if present.

    Declaration

    Swift

    public var first: Option<A> { get }
  • Retrieves the value of the second type, if present.

    Declaration

    Swift

    public var second: Option<B> { get }
  • Retrieves the value of the third type, if present.

    Declaration

    Swift

    public var third: Option<C> { get }
  • Retrieves the value of the fourth type, if present.

    Declaration

    Swift

    public var fourth: Option<D> { get }
  • Retrieves the value of the fifth type, if present.

    Declaration

    Swift

    public var fifth: Option<E> { get }
  • Retrieves the value of the sixth type, if present.

    Declaration

    Swift

    public var sixth: Option<F> { get }
  • Retrieves the value of the seventh type, if present.

    Declaration

    Swift

    public var seventh: Option<G> { get }
  • Retrieves the value of the eighth type, if present.

    Declaration

    Swift

    public var eighth: Option<H> { get }
  • Retrieves the value of the ninth type, if present.

    Declaration

    Swift

    public var ninth: Option<I> { get }
  • Retrieves the value of the tenth type, if present.

    Declaration

    Swift

    public var tenth: Option<J> { get }