Abstract:
As an important programming paradigm,generic programming relieves the programmer from repeatedly writing codes of similar functionality for different data types.In functional programming,equality function is a very common operator for comparing two values of the same data type,we use this concrete example to explain the basic method of constrcuting generic programs and polytypic values.The methods are capable of defining equality on every data type.Moreover,this way of defining equality can be generalized naturally to a large number of other functions.