April 2018
Intermediate to advanced
396 pages
11h 8m
English
Before we show an example functor trait based on the laws we showed in the preceding section, you can conclude that standard Scala types such as List, Option, and others that define a map method are functors.
If we want to create our own types that follow the functor laws, we can create a base trait and make sure to implement it:
trait Functor[F[_]] { def map[
Read now
Unlock full access