1. A method of minimizing code duplication in a statically typeable language program comprising: receiving a plurality of trees of functional instructions for a program, each of said plurality of trees including at least one functional node; comparing said plurality of trees of functional instructions for a program; merging said trees of functional instructions to eliminate similar function nodes; and producing a combined module from results of said merging, said combined module having code duplication removed therefrom.