Assume the following:
1. We have a type T with multiple constructors, but lets assume we're on a 64 bit machine and have at least 4 but no more than 7 constructors so we can still use pointer tagging.
2. And a function "f :: T -> T -> T"
3. Each combination of constructors (16 in the 4 constructor case, 49 in the 7 constructor case) has an implementation (naturally many of these will call helper functions). There's no wildcard matches.
How will GHC generate the code for "f"? Will pushing through LLVM make any difference?
Do we take the number of the first constructor, and then multiply the number of the second constructor by say 7, and then do one jump via a jump table?
Is there a bunch of nested jump tables, each with 7 options?
Is there a fall through if statement?
Something else?
I understand this probably a complex answer and perhaps doesn't have a simple answer, but I just wanted to get some sort of idea in my head of how GHC attempts to resolve code like this.