//workflow/com.squareup.workflow1/contraMap
contraMap¶
[jvm]
Content
fun <T1, T2> Sink<T1>.contraMap(transform: (T2) -> T1): Sink<T2>
More info
Generates a new sink of type T2.
Given a transform closure, the following code is functionally equivalent:
1 2 3 |
|
Trivia: Why is this called contraMap? - map turns Type
Another way to think about this is: map transforms a type by changing the output types of its API, while contraMap transforms a type by changing the input types of its API.