MetaFun is a program to compile functional programs into C++ template metaprograms. It allows you to write programs in a very Haskell-like language, and then use them as compile-time C++ metaprograms.
See the details at http://gergo.erdi.hu/projects/metafun/