What is frustration of purpose under contract law?

When doing the thing you were supposed to do under the contract would undermine the point of the contract.