<div dir="ltr">Assume the following:<div><br></div><div>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. </div><div>2. And a function "f :: T -> T -> T"</div><div>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. </div><div><br></div><div>How will GHC generate the code for "f"? Will pushing through LLVM make any difference?</div><div><br></div><div>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?</div><div><br></div><div>Is there a bunch of nested jump tables, each with 7 options?</div><div><br></div><div>Is there a fall through if statement?</div><div><br></div><div>Something else?</div><div><br></div><div>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.</div></div>