:: [[a]] -> [a] package:control-monad-omega

This is the hinge algorithm of the Omega monad, exposed because it can be useful on its own. Joins a list of lists with the property that for every i j there is an n such that xs !! i !! j == diagonal xs !! n. In particular, n <= (i+j)*(i+j+1)/2 + j.