Any Clay procedure can be prefixed with one or more 'pattern variables' which can then be used for specifying argument types as patterns. Pattern variables are similar to template parameters in C++ except that these pattern variables are bound by pattern matching against the types of actual arguments at the call site. Arbitrary predicates can be written to specify requirements on pattern variables. Any user defined procedure returning a boolean can be used as a predicate. Here is a generic version of factorial: [T | Integer?(T)] factorial(n:T) { if (n <= T(1)) return T(1); return n * factorial(n - T(1)); } The first line is read as "T, such that Integer?(T)". To call factorial simply write "factorial(7)". The pattern variable 'T' will be bound to 'Int' because the literal '7' is of type 'Int'. If instead 'factorial' is called with a value of arbitrary-precision integer type then T will be bound to the arbitrary-precision integer type. Clay supports overloading of procedures based on arbitrary predicates. (This is more powerful than the constrained form of overloading enabled by haskell type-classes.) The compiler generates efficient code because all procedures are specialized to the types of the arguments. I have conducted a few performance tests which indicate that generic programs written in Clay perform the same as equivalent non-generic versions written in C.