I have a function
f :: Int -> Int -> Int
and I have a list of arbitrary length but for the sake of the example:
[x1,x2,x3]
I need to apply f to the list such that the resulting list looks like this:
[f x1 x1 + f x1 x2 + f x1 x3 , f x2 x1 + f x2 x2 + f x2 x3 , f x3 x1 + f x3 x2 + f x3 x3]
I know that
map f [x1,x2,x3] will give [f x1, f x2, f x3]
but this doesn't seem like much help here. What's the best way to do it?