How to define <*> for Option[List[_]] n Scala
问题 This is a followup to my previous question with an example found on the Internet. Suppose I define a typeclass Applicative as follows: trait Functor[T[_]]{ def map[A,B](f:A=>B, ta:T[A]):T[B] } trait Applicative[T[_]] extends Functor[T] { def unit[A](a:A):T[A] def ap[A,B](tf:T[A=>B], ta:T[A]):T[B] } I can define an instance of Applicative for List object AppList extends Applicative[List] { def map[A,B](f:A=>B, as:List[A]) = as.map(f) def unit[A](a: A) = List(a) def ap[A,B](fs:List[A=>B], as