0

How to you write a function that gives a list of all the possible pairs of numbers from a list of numbers in haskell? for instance

[1, 7, 4]

gives

[(1, 7), (1, 4), (7, 4)]

I've tried using zip like

numPairs :: [(Int, Int)]
numPairs
  = zip [1000..9999] [1000..9999]

but this didn't really work in the slightest.

0 Answers0