Divide

public protocol Divide : Contravariant

Divide is a type class that models the divide part of divide and conquer.

  • Takes two computations and provides a computation using a function that specifies how to divide the returned type into the two provided types.

    Declaration

    Swift

    static func divide<A, B, C>(_ fa: Kind<Self, A>, _ fb: Kind<Self, B>, _ f: (C) -> (A, B)) -> Kind<Self, C>

    Parameters

    fa

    1st computation.

    fb

    2nd computation.

    f

    Dividing function.

    Return Value

    A computation that merges the divided parts.