arrow-generic / arrow.generic.coproduct4 / fold

fold

fun <A, B, C, D, RESULT> Coproduct4<A, B, C, D>.fold(a: (A) -> RESULT, b: (B) -> RESULT, c: (C) -> RESULT, d: (D) -> RESULT): RESULT

Runs the function related to the actual value of the Coproduct and returns the result

Parameters

a - The function used to map A to the RESULT type

b - The function used to map B to the RESULT type

c - The function used to map C to the RESULT type

d - The function used to map D to the RESULT type

Return RESULT generated by one of the input functions