September 2021
Intermediate to advanced
504 pages
12h 50m
English
Higher-kinded types are an advanced language feature that languages like Kotlin and Java do not support. Although this might change in the future, the Arrow team has provided an interim workaround. This solution might not be as intuitive as those found in other languages, but it is still workable. That said, the Arrow team has gone to great lengths to make this feature as easy to use as possible.
Let’s look at the Foldable interface as an example of a higher-kinded type. We declare a new instance of this interface that is a ListFoldable, a Foldable of the List type. Let’s express this exact situation with a snippet of pseudocode:
interface Foldable<F<A>> {
//some abstract methods
Read now
Unlock full access