Haskell Is there a function for creating every variation of applying a function to a list
问题 I want to create a list of variations of applying a function to every element of a list. Here is a quick example of what I mean. applyVar f [a, b, c] >> [[(f a), b, c], [a, (f b), c], [a, b, (f c)]] Essentially It applies a function to each element of a list individually and stores each possible application in an array. I'm not too sure how to approach a problem like this without using indexes as I have heard they are not very efficient. This is assuming that the function f returns the same