Abstract:O'Caml is a popular functional programming language with a lot of advanced features, such as: simple module, clear grammar and semantci, etc. Generic programming which programs through the abstracting of algorithm, data structure and all other of the software components can avoid the repeated work of coding with similar functions. In order to combine the generic programming and O'Caml language which can improve the reuse of soft, we extend the grammar of O'Caml language to implement type-indexed function, the structure transition and isomorphism of type and generic function. The experimental result shows that the implementation of generic programming in O'Caml language has improved the efficiency and universality of programming.