
In principle there shouldn't be any impact on performance. Type classes are resolved at compile time, and you only use the generic implementations at known types. All of the relevant dictionaries are known at compile-time, so with enough inlining and simplification the generic constructors and other indirections should be eliminated. In practice, inlining is still very heuristic, so you have to look at the generated code and maybe add INLINEABLE annotations and tweak other things to make sure it happens. The inspection-testing library (https://hackage.haskell.org/package/inspection-testing) enables automated tests that make sure that the code optimized by the compiler doesn't contain certain constructs that indicate missed inlining opportunities.
Thanks a lot, I will use this and see what is going one. Fred