Common Haskell types and type classes implemented as C++ templates