I would like to be able to use scalaz | @ | on my own application functor.
Example:
val spread: Source[Yield] = (y2 |@| y1)(_ - _)
This is my class
sealed abstract class Source[+A] {
def map[B](f: A => B): Source[B]
def unit[A](a: A): Source[A]
def pureList[A](la: List[A]): Source[A]
def zero[A]: Source[A]
def map2[A, B, C](as: Source[A], bs: Source[B], f: (A, B) => C): Source[C]
}
I am sure that I need to implement map, because it is a functor.
An application can be implemented in various ways: for example, using apply()and unit()or map2()and unit().
Do I need apand pure?
As you can see, I'm not sure what is needed.
source
share