I just realized what a type of constructor and state of a higher type are, and now I'm trying to understand the Monad. Here's what the Monaddash looks like in scalaz:
trait Monad[F[_]] extends Applicative[F] with Bind[F] { self =>
////
override def map[A,B](fa: F[A])(f: A => B) = bind(fa)(a => point(f(a)))
//The rest is omitted
}
The question is, I don’t understand why Monadis a higher type of type? We have standard monads List[T], Option[T]which are not more sort types.
I am not an expert in the Theory category, so I see the monad as a container with monad laws.
Why don't we just declare the monad as follows:
trait Monad[V]{
}
No higher view.
How does a standard font Option[T]look like a subclass in this case, for example?
source
share