News for hackers. Stuff that matters.
Re:Functional isn't always better by FalconNL on Friday October 07, 2011 @01:42PM (#3085009)
And yet another short, functional solution:

    pairs = (>>= \ ~(x:xs) -> map ((,) x) xs) . init . tails
EDIT: Or as a list comprehension:

    pairs xs = concat [map ((,) h) t | (h:t) <- tails xs]

There are no comments on this comment yet.