Yesterday we reviewed kinds and types, explored Tagged type, and started looking at Semigroup
and Monoid
as a way of abstracting binary operations over various types.
I’ve gotten a few feedbacks. First, paulp suggested that I could use companion type like Option.type
for our kind
calculator:
@eed3si9n It’s a sad hack, but you should be able to ask for kind[Option.type] and look up the kind of the companion class.
— Paul Phillips (@extempore2) September 3, 2012
Using the updated version, we get the following:
scala> kind[Functor.type]
res1: String = Functor's kind is (* -> *) -> *. This is a type constructor that takes type constructor(s): a higher-kinded type.