replacing every pair in a list
You can use the lens library to remove the need for the setList function. The ix lens does this, giving read+write access to an element at an index. The type of this is:

ix :: Index m -&gt; Traversal' m (IxValue m)


Or, for lists in particular:

ix :: Int-&gt; Traversal' [a] a


Using the .~ operator, the value of a lens can be set. So to remove need for the setList funtion, just use this:

applyToEveryPair2 :: ((a,a) -&gt; [(a,a)]) -&gt; [a] -&gt; [[a]]
applyToEveryPair2 f (xs) = do i&lt;-[0..length xs - 1]
                              j&lt;-[0..length xs - 1]
                              guard (i /= j)
                              (x',y') &lt;- f (xs !! i, xs !! j)
                              return . (ix i .~ x') . (ix j .~ y') $ xs


The other thing to notice about your code is it will call every pair of elements twice: eg it will call the supplied function with the item at index 2 and 5, then with the items at indexes 5 and 2. I'm not sure if this is intended.