RULES for SPECIALIZ(E)ations
simonpj at microsoft.com
Mon Oct 20 13:01:59 EDT 2003
| I suppose I'm being bitten by User's Guide 7.8.2:
| "If more than one rule matches a call, GHC will choose one
| to apply."
| even if a bit later it says:
| "So a rule only matches if the types match too."
| Am I understanding right and it's that so?
I think so. After all, the types match for count/generic too.
Maybe you want a rule
genericLength = length
which will replace a call to (genericLength at type Int) by a call to
You can also use "phases" to control order of rule application (albeit
More information about the Glasgow-haskell-users