Add an 'eachPair' function to the library.