[Haskell-beginners] Function definition order and performance

Zhi-Qiang Lei zhiqiang.lei at gmail.com
Mon Jun 6 15:58:19 CEST 2011


Hi,

If the matching proceeds from top to bottom, will the same functions defined in different order have different performance strictly? Thanks.

Quote from Real World Haskell:

"As we have already mentioned, a Haskell implementation checks patterns for matches in the order in which we specify them in our equations. Matching proceeds from top to bottom, and stops at the first success. Equations below a successful match have no effect."

Best regards,
Zhi-Qiang Lei
zhiqiang.lei at gmail.com

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/beginners/attachments/20110606/e3196e8d/attachment.htm>


More information about the Beginners mailing list