February 2018
Intermediate to advanced
350 pages
7h 35m
English
Applying curried to a function of n parameters, for example, (A, B) -> R, transforms it into a chain of the n function calls, (A) -> (B) -> R:
import arrow.syntax.function.curriedimport arrow.syntax.function.pipeimport arrow.syntax.function.reverseimport arrow.syntax.function.uncurriedfun main(args: Array<String>) { val strong: (String, String, String) -> String = { body, id, style -> "<strong id=\"$id\" style=\"$style\">$body</strong>" } val curriedStrong: (style: String) -> (id: String) -> (body: String) -> String = strong.reverse().curried() val greenStrong: (id: String) -> (body: String) -> String = curriedStrong("color:green") val uncurriedGreenStrong: (id: String, body: String) -> String = greenStrong.uncurried() println(
Read now
Unlock full access