
Hi,
If the matching proceeds from top to bottom, will the same functions defined in different order have different performance strictly? Thanks.
You should only see a performance difference at all in the case of very complicated (run-time-wise) guards on pattern matches. Usually, your pattern matches will have to be placed in a certain order for *semantic* purposes (i.e. for them to not be overlapping.) I could imagine a scenario in which a complicated guard on a pattern match, which could be otherwise rearranged without changing its semantics, on a function that is itself in the oft-executed loop of an inner function of an algorithm with high complexity *could* have a noticeable impact on performance. In other words, premature optimization is the root of all evil. Are you concerned about a particular case? Example code could help us determine the reason for slowness. Regards, Aleks