Iterate over all pair combinations without repetition in Haskell

What about:

[ (x,y) | (x:rest) <- tails xs , y <- rest ]

Leave a Comment