Parameter order in <*> and parentheses in Scala

<*>presented as a method M[A]that accepts M[A=>B]. This is why I need brackets:

val f: A => B => C = ...
val as: List[A] = ...
val bs: List[B] = ...
val cs: List[C] = ...
val r = cs <*> (bs <*> (as <*> List(f)))  

On the other hand, if I define <*>as a method M[A=>B]that accepts M[A], I can write

val r = List(f) <*> ma <*> mb <*> mc

Does it make sense?

+4
source share

All Articles