Given the names of a generic class, a GADT type to instantiate, a function
in the class and the default implementation, generates the code for a basic
generic instance. This is tricky in general because we have to analyze the
return types of each of the GADT constructors and give instances accordingly.