I am trying to find an implementation for this Scala function signature:
def explode[A, B](f: A => List[B]): List[A => B]
The opposite direction is possible:
def nest[A, B](fs: List[A => B]): A => List[B] = (a: A) => fs.map(_(a))
By now I am tending to believe the first one (explode
) is unimplementable, but I am happy to be proven wrong. If it is indeed not possible to implement, is there a deep reasoning behind it?
In my view, I am essentially asking the compiler to "duplicate" that input A
some n
times (the List
s size), and "fix" it as input.