Isequal for composite types

Is there a library that helps define isequal recursively for composite types? The code is trivial, but I find I keep using it in many places, so it would be nice to either use an existing library, of if there is none, wrap it up myself.

Should also help to you not miss hash.