Suppose I've got a list of functions List[A => B]
and need a function that returns List[B]
for a given value of type A
:
def foo[A, B](fs: List[A => B]): A => List[B] = a => fs.map(_.apply(a))
Is there any simpler (maybe with cats
) way to write List[A => B] => A => List[B]
?