February 2018
Intermediate to advanced
350 pages
7h 35m
English
With function composition, we take two functions to create the third function; with partial application, we create a new function by passing a parameter to an existing function.
Arrow comes with two flavours of partial application—explicit and implicit.
The explicit style uses a series of extension functions called partially1, partially2, all the way up to partially22. The implicit style takes a series of extensions, overloading the invoke operator:
package com.packtpub.functionalkotlin.chapter11import arrow.syntax.function.invokeimport arrow.syntax.function.partially3fun main(args: Array<String>) { val strong: (String, String, String) -> String = { body, id, style -> "<strong id=\"$id\" style=\"$style\">$body</strong>" ...
Read now
Unlock full access