https://kotlinlang.org logo
#arrow
Title
# arrow
r

raulraja

12/10/2017, 5:04 PM
What higher kinded types brings covers that use case and is even more powerful. It brings the ability to define fully polymorphic programs that are abstract in the
F<A>
they return and allow you to define actions for a constrained interface parametric to that type. An example of such constrained interface would be
Monad<F>
for example were we can
flatMap
,
map
,
flatten
... and other things with
F
without telling us what
F<_>
actually refers to. So higher kinds + type classes gives you the ability to define polymorphic programs where we can code in terms of behaviors instead of data types and get compile time verification that our constrains expressed as dependencies are correct when those programs are made concrete over data types at a call site.